toJsonObject

fun Map<String, Any>.toJsonObject(): JsonObject

EXPERIMENTAL Convert a Map into a generic JsonObject.

If a value of the Map is not a JsonElement, a Boolean or a Number then its .toString method is used to serialize it.