getValue

inline operator fun <R> Parameters.getValue(thisRef: Any?, property: KProperty<*>): R(source)

Operator function that allows to delegate variables by call parameters. It does conversion to type R using DefaultConversionService If R is nullable and no values are associated with the delegated property name, returns null.

Example

get("/{path}") {
val path: Int by call.pathParameters
val query: String? by call.queryParameters
// ...
}

Throws

if no values associated with name and R is not nullable

when conversion from String to R fails

Report a problem