to

infix fun String.to(value: String)
infix fun String.to(value: Number)
infix fun String.to(value: Boolean)
infix fun String.to(value: Nothing?)
infix fun String.to(value: List<*>)


infix fun String.to(block: JsonDataBuilder.() -> Unit)

Nested object using "key" to { ... } syntax.


infix fun String.to(value: JsonElement)

Escape hatch for callers that already hold a raw JsonElement (e.g. extracted from a credential subject). Prefer the typed forms above.


@JvmName(name = "toAny")
infix fun String.to(value: Any?)

Catch-all overload that accepts nullable primitives (String?, Int?, etc.) and arbitrary Any? values. Resolves only when the typed overloads above don't match. null becomes JsonNull.