Last active
June 20, 2024 11:10
-
-
Save MeNiks/597b761f3b2ea8ec511d5d40a3213399 to your computer and use it in GitHub Desktop.
Add/Update properties of kotlinx.serialization.json.JsonObject
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlinx.serialization.json.JsonObject | |
import kotlinx.serialization.json.jsonObject | |
fun JsonObject.addUpdateJsoObject(updateJsonObject: JsonObject): JsonObject { | |
return JsonObject( | |
toMutableMap() | |
.apply { | |
updateJsonObject.forEach { (key, je) -> | |
put(key, je) | |
} | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment