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

com.justai.jaicf.channel.yandexalice.JSON.kt Maven / Gradle / Ivy

Go to download

JAICF-Kotlin Yandex Alice Channel implementation. Enables JAICF-Kotlin integration with Alice.

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