Skip to content

JsonSerializer

Xavier F. Gouchet edited this page Sep 4, 2024 · 1 revision

object JsonSerializer

Functions

safeMapValuesToJson

fun Map<String, Any?>.safeMapValuesToJson(internalLogger: InternalLogger): Map<String, JsonElement>

This method will convert all values to JSON in a safe way, meaning if serialization fails for the particular value, the process will continue and faulty value will be dropped.

toJsonElement

fun toJsonElement(item: Any?): JsonElement

Converts arbitrary object to the JsonElement with the best effort. Any.toString is used as a fallback.

Clone this wiki locally