Klaxon

To implement custom JSON configuration, create your own object singleton. Extra mappings can be added before done() is called.

Properties

Link copied to clipboard
open override val defaultContentType: ContentType

Functions

Link copied to clipboard
inline fun <T : Any> asA(input: InputStream): T
inline fun <T : Any> asA(input: String): T
fun <T : Any> String.asA(target: KClass<T>): T
open override fun <T : Any> asA(input: InputStream, target: KClass<T>): T
open override fun <T : Any> asA(input: String, target: KClass<T>): T
Link copied to clipboard
open override fun asFormatString(input: Any): String
Link copied to clipboard
open fun asInputStream(input: Any): InputStream
Link copied to clipboard
inline fun <T : Any> Body.Companion.auto(description: String? = null, contentNegotiation: ContentNegotiation = ContentNegotiation.None, contentType: ContentType = defaultContentType): BiDiBodyLensSpec<T>
Link copied to clipboard
inline fun <T : Any> autoBody(description: String? = null, contentNegotiation: ContentNegotiation = ContentNegotiation.None, contentType: ContentType = defaultContentType): BiDiBodyLensSpec<T>
Link copied to clipboard
inline fun <IN : Any, OUT : Any> autoLens(lens: BiDiLensSpec<IN, String>): BiDiLensSpec<IN, OUT>
Link copied to clipboard
inline fun <IN : Any, OUT : Any> convert(input: IN): OUT
Link copied to clipboard
inline operator fun <T : Any, R : HttpMessage> ConfigurableKlaxon.invoke(item: T): (R) -> R
inline operator fun <T : Any> ConfigurableKlaxon.invoke(msg: HttpMessage): T
Link copied to clipboard
inline fun <T : Any> HttpMessage.json(): T

Convenience function to read an object as JSON from the message body.

inline fun <T : Any, R : HttpMessage> R.json(t: T): R

Convenience function to write the object as JSON to the message body and set the content type.