com.justai.jaicf.channel.yandexalice.JSON.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yandex-alice Show documentation
Show all versions of yandex-alice Show documentation
JAICF-Kotlin Yandex Alice Channel implementation. Enables JAICF-Kotlin integration with Alice.
The newest version!
package com.justai.jaicf.channel.yandexalice
import com.justai.jaicf.channel.yandexalice.api.model.Card
import com.justai.jaicf.channel.yandexalice.api.model.Image
import com.justai.jaicf.channel.yandexalice.api.model.ImageGallery
import com.justai.jaicf.channel.yandexalice.api.model.ItemsList
import kotlinx.serialization.json.Json
import kotlinx.serialization.modules.SerializersModule
internal val JSON = Json {
classDiscriminator = "type"
ignoreUnknownKeys = true
isLenient = true
encodeDefaults = true
serializersModule = SerializersModule {
polymorphic(Card::class, Image::class, Image.serializer())
polymorphic(Card::class, ItemsList::class, ItemsList.serializer())
polymorphic(Card::class, ImageGallery::class, ImageGallery.serializer())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy