DebugPathParams

Declares the parameters in a route's path (DebugRoute.path): one for each segment in braces, with the name in the braces. A path parameter is always present, so its value is never null. For the route's own method, a segment that the parameter does not take, such as x for an int, or a value that is not one of DebugStringSpec.values, matches no route: the path names a resource that does not exist, so the client gets 404, not 400. The router checks the method first, so another method gets 405 with an Allow header.

Functions

Link copied to clipboard
fun int(name: String, declare: DebugIntegerSpec.() -> Unit = {}): DebugParam<Int>

Declares the path parameter {name} as a whole number, from Int.MIN_VALUE to Int.MAX_VALUE unless narrowed.

Link copied to clipboard
fun long(name: String, declare: DebugIntegerSpec.() -> Unit = {}): DebugParam<Long>

Declares the path parameter {name} as a whole number, as a Long.

Link copied to clipboard
fun string(name: String, declare: DebugStringSpec.() -> Unit = {}): DebugParam<String>

Declares the path parameter {name} as a string.