All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.algolia.instantsearch.insights.internal.extension.Json.kt Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 3.3.1
Show newest version
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