Thread
#serialization
    Kuba Petržílka

    Kuba Petržílka

    7 months ago
    Hello, how can I configure the following:
    sealed interface SystemXsId {
        @Serializable
        @JvmInline
        value class Known(val value: NonEmptyString) : SystemXsId
    
        @Serializable
        object Unknown : SystemXsId
    }
    to be serialized either as: • the value of NonEmptyString (which is already serializable and it works) - in case it is
    Known
    • null in case it is
    Unknown
    I probably have to specify an explicit serializer for the sealed interface, but how would it look like?
    Dominaezzz

    Dominaezzz

    7 months ago
    See the above thread for a hint.