api

http4k / org.http4k.format / ConfigurableMoshi

ConfigurableMoshi

open class ConfigurableMoshi : AutoMarshalling

Constructors

Name Summary
<init> ConfigurableMoshi(builder: Builder, defaultContentType: ContentType = APPLICATION_JSON)

Properties

Name Summary
defaultContentType val defaultContentType: ContentType

Functions

Name Summary
asA open fun <T : Any> asA(input: String, target: KClass<T>): T
asFormatString open fun asFormatString(input: Any): String
asJsonString fun <T : Any> asJsonString(t: T, c: KClass<T>): String

Companion Object Functions

Name Summary
auto fun <T : Any> Body.Companion.auto(description: String? = null, contentNegotiation: ContentNegotiation = None, contentType: ContentType = defaultContentType): BiDiBodyLensSpec<T>
fun <T : Any> WsMessage.Companion.auto(): BiDiWsMessageLensSpec<T>

Inheritors

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