File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -417,10 +417,11 @@ fun main() {
417417
418418### Registering sealed children as subclasses
419419A sealed parent interface or class can be used to directly register all its children using ` subclassesOfSealed ` .
420- This will expose all children that would be available when serializing the parent directly, but now as sealed. Please
421- note that this is will remain open serialization, and the sealed parent serializer will not be used in serialization.
422- In addition, it is not valid if the hierarchy contains open (not sealed) polymorphic children (this will result in
423- an error at runtime). In other words all children/descendants must be either concrete or sealed.
420+ This will allow serializing the children using open polymorphism without the need to register each one individually.
421+
422+ If one of the type's subclasses is a sealed serializable class on its own, its subclasses are registered recursively
423+ as well. However, if one of the type's subclasses is an open polymorphic class, an [ IllegalArgumentException] is thrown.
424+ In other words, all children/descendants must be either concrete or sealed.
424425
425426<!-- - TEST -->
426427
You can’t perform that action at this time.
0 commit comments