api

http4k / org.http4k.contract / RouteMetaDsl / receiving

receiving

fun <T> receiving(body: Pair<BiDiBodyLens<T>, T>, definitionId: String? = null): Unit

Add an example request (using a Lens and a value) to this Route. It is also possible to pass in the definitionId for this request body which will override the naturally generated one.

fun receiving(requestMeta: HttpMessageMeta<Request>): Unit

Add request metadata to this Route. A route only supports a single possible request.

fun <T> receiving(bodyLens: BiDiBodyLens<T>): Unit

Set the input body type for this request WITHOUT an example. Hence the content-type will be registered but no example schema will be generated.