RouteMetaDsl

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun callback(name: String, fn: () -> Pair<String, WebCallback>)
Link copied to clipboard
Link copied to clipboard
fun receiving(requestMeta: HttpMessageMeta<Request>)

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

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

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.

@JvmName(name = "receivingNegotiated")
fun <T> receiving(negotiated: Pair<AutoContentNegotiator<T>, T>, definitionId: String? = null, schemaPrefix: String? = null)

Add negotiated example requests to this route. It is also possible to pass in the definitionId for this request body which will override the naturally generated one.

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

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.

Link copied to clipboard
@JvmName(name = "returningResponse")
fun returning(vararg descriptionToResponse: Pair<String, Response>)

Add possible responses to this Route.

@JvmName(name = "returningStatus")
fun returning(vararg statusesToDescriptions: Pair<Status, String>)

Add a possible response description/reason and status to this Route

@JvmName(name = "returningResponseMeta")
fun returning(vararg responseMetas: HttpMessageMeta<Response>)

Add possible response metadata to this Route. A route supports multiple possible responses.

@JvmName(name = "returningStatus")
fun returning(vararg statuses: Status)

Add possible response statuses to this Route with no example.

@JvmName(name = "returningStatusNegotiated")
fun <T : Any> returning(status: Status, negotiated: Pair<AutoContentNegotiator<T>, T>, description: String? = null, definitionId: String? = null, schemaPrefix: String? = null)

Add all negotiated responses, with samples. It is also possible to pass in the definitionId for this response body which will override the naturally generated one.

@JvmName(name = "returningStatus")
fun <T> returning(status: Status, body: Pair<BiDiBodyLens<T>, T>, description: String? = null, definitionId: String? = null, schemaPrefix: String? = null)

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