resource

inline fun <T : Any> <ERROR CLASS>.resource(noinline body: <ERROR CLASS>.() -> Unit): <ERROR CLASS>

Registers a route body for a resource defined by the T class.

A class Tmust be annotated with io.ktor.resources.Resource.


fun <T : Any> <ERROR CLASS>.resource(serializer: <ERROR CLASS><T>, body: <ERROR CLASS>.() -> Unit): <ERROR CLASS>

Registers a route body for a resource defined by the T class.

Parameters

serializer

is used to decode the parameters of the request to an instance of the typed resource T.

A class Tmust be annotated with io.ktor.resources.Resource.