query

fun <Q : Any> query(name: String, codec: StringCodec<Q>): QueryParameter<Q>(source)

Defines a required query parameter.

Add it to a URI template with + so the query parameter becomes part of the endpoint contract without affecting the literal path segments.


fun <Q : Any> query(name: String, codec: StringCodec<Q>, default: Q?): QueryParameter<Q>(source)

Defines an optional query parameter by recording the default to use when callers omit it.


Shortcut to the predefined QueryParameter factory methods such as QueryParameter.Companion.int.