JsonDataBuilder
class JsonDataBuilder
Typed JSON object builder. Callers stay in plain Kotlin types — no JsonElement / buildJsonObject / put in user code:
jsonData {
"floodDepthCm" to 75.0
"stationId" to "STA-42"
"location" {
"lat" to 40.7128
"lon" to -74.0060
}
"tags" to listOf("flood", "urgent")
}Content copied to clipboard
Used across the framework anywhere a JsonObject payload is needed (contract trigger data, contract draft data, VC subject claims, audit records, …).
Functions
Link copied to clipboard
Nested object using "key" { ... } syntax.
Link copied to clipboard
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.
Nested object using "key" to { ... } syntax.
Escape hatch for callers that already hold a raw JsonElement (e.g. extracted from a credential subject). Prefer the typed forms above.