ResponseDsl

DSL marker class holding OpenAPI response metadata for a route handler. These functions are no-ops at runtime and only serve route-documentation metadata.

Functions

Link copied to clipboard
inline fun <T> respondsCreated(description: String = "Resource created")

Declares a 201 Created response returning T wrapped in KeelResponse<T>.

Link copied to clipboard
fun respondsError(status: HttpStatusCode = HttpStatusCode.InternalServerError, description: String = "Error response")

Declares an error response with the given status code.

Link copied to clipboard
inline fun <T> respondsOk(description: String = "Successful operation")

Declares a successful (200 OK) response returning T wrapped in KeelResponse<T>.

Link copied to clipboard

Declares the standard set of error responses (400, 404, 500) that most Keel endpoints can return.