Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ object AppUtils {
inline fun <reified T : Any> parseJson(value: String): T {
// @Serializable generates a serializer at compile time; contextual serializers are
// registered manually in serializersModule, we need both to support all cases
val serializer = runCatching { serializer<T>() }.runCatching {
json.serializersModule.getContextual(T::class)
}.getOrNull()
val serializer = runCatching { serializer<T>() }.getOrNull()
?: json.serializersModule.getContextual(T::class)

// Prefer Kotlin Serialization over Jackson
if (serializer != null) {
Expand Down Expand Up @@ -94,4 +93,4 @@ object AppUtils {
null
}
}
}
}