register
inline fun <Req, Res, ReqH, ResH, PathP, QueryP, CookieP> ApiContract<Req, Res, ReqH, ResH, PathP, QueryP, CookieP>.register(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Res, ReqH, ResH, PathP, QueryP, CookieP>.(Req, PathP, QueryP) -> ApiResponse<Res, ResH>): RoutingHttpHandler
Creates a route for the given ApiContract.
Context parameters in the handler can be accessed via contextOf.
Parameters
filter
The filter to apply to the route.
handler
The handler function for the route.
inline fun <Req, ReqH, PathP, QueryP, CookieP> ApiContract<Req, Unit, ReqH, Empty, PathP, QueryP, CookieP>.register(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Unit, ReqH, Empty, PathP, QueryP, CookieP>.(Req, PathP, QueryP) -> Unit): RoutingHttpHandler
Overload for register that allows returning Unit when the response body is Unit and headers are Empty.
inline fun <Req, Res, ReqH, ResH, CookieP> ApiContract<Req, Res, ReqH, ResH, Empty, Empty, CookieP>.register(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Res, ReqH, ResH, Empty, Empty, CookieP>.(Req) -> ApiResponse<Res, ResH>): RoutingHttpHandler
Simplifies registration for ApiContract types with no path or query parameters.
inline fun <Req, ReqH, CookieP> ApiContract<Req, Unit, ReqH, Empty, Empty, Empty, CookieP>.register(filter: Filter = Filter.NoOp, crossinline handler: context(Request, Raise<Issue>, ReqH, CookieP, Principal) ApiContract<Req, Unit, ReqH, Empty, Empty, Empty, CookieP>.(Req) -> Unit): RoutingHttpHandler
Overload for register (simple) that allows returning Unit when the response body is Unit and headers are Empty.