Makes the Kotlin Serialization lenient to avoid unnecessary crashes
This commit is contained in:
+1
@@ -54,6 +54,7 @@ object JsonMapper {
|
|||||||
val jsonInstance =
|
val jsonInstance =
|
||||||
Json {
|
Json {
|
||||||
ignoreUnknownKeys = true
|
ignoreUnknownKeys = true
|
||||||
|
isLenient = true
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun <reified T> fromJson(json: String): T = jsonInstance.decodeFromString<T>(json)
|
inline fun <reified T> fromJson(json: String): T = jsonInstance.decodeFromString<T>(json)
|
||||||
|
|||||||
Reference in New Issue
Block a user