QueryParameter

data class QueryParameter<Q : Any>(val name: String, val codec: StringCodec<Q>, val required: Boolean, val default: Q?) : Parameter<Q> (source)

Query parameter definition with optional default values.

Constructors

Link copied to clipboard
constructor(name: String, codec: StringCodec<Q>, required: Boolean, default: Q?)

Properties

Link copied to clipboard
open override val codec: StringCodec<Q>

Codec responsible for encoding and decoding parameter values.

Link copied to clipboard
val default: Q?

optional fallback when the caller omits the query parameter. Optional parameters must supply a default.

Link copied to clipboard
open override val name: String

Canonical parameter name.

Link copied to clipboard
open override val position: ParameterPosition

Location of the parameter within the HTTP request.

Link copied to clipboard
open override val required: Boolean

Indicates whether the parameter must be supplied by the caller.

Functions

Link copied to clipboard
fun optional(default: Q): QueryParameter<Q>

Returns an optional version of this parameter with the supplied default value.