I have a List of sealed subclasses that I am deser...
# serialization
m
I have a List of sealed subclasses that I am deserializing. The serialized list may contain subclass types that don't exist, in which case I want to ignore them (instead of failing). How can I achieve that? I'm looking for something like
ignoreUnknownKeys
but for polymorphic serialization, where I want to ignore unknown subclasses.
m
I saw this, it allows for deserializing an unknown type to some default value. I don't want to deserialize it.
a
Perhaps you could filter that unwanted type after that.
m
Yes, the problem is that I'd need that dummy type in my sealed structure, and have a case for it in every when statement where I used that sealed interface
e
@Marcin Wisniowski I think the serializer-builder being added in my serialization lib might solve this for you.. feel free to check the PR, I would appreciate any feedback! https://github.com/Kantis/ks3/pull/103
Assuming you're working with json 🙂