concat

inline fun <T> JsonObject.concat(data: T, json: Json = Json): JsonObject

Concats the fields of a serializable data class data into this JsonObject.

Fields from data will overwrite any existing fields with the same key.

Return

A new JsonObject with the merged fields.

Parameters

T

The serializable type of the data class.

data

The data class instance to merge.

json

The Json instance to use for serialization (defaults to Json).