commonMain.com.algolia.instantsearch.insights.internal.extension.Json.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of instantsearch-insights Show documentation
Show all versions of instantsearch-insights Show documentation
InstantSearch Android is a library providing widgets and helpers to help you build the best instant-search experience on Android with Algolia. It is built on top of Algolia's Kotlin API Client to provide you a high-level solution to quickly build various search interfaces.
package com.algolia.instantsearch.insights.internal.extension
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.decodeFromJsonElement
internal val JsonNonStrict = Json {
ignoreUnknownKeys = true
isLenient = true
allowSpecialFloatingPointValues = true
encodeDefaults = true
}
internal fun JsonElement?.deserializeString(): String {
return if (this != null) JsonNonStrict.decodeFromJsonElement(this) else error("null json element")
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy