KeepGeneratedSerializer

Instructs the serialization plugin to keep automatically generated implementation of KSerializer for the current class if a custom serializer is specified at the same time @Serializable(with=SomeSerializer::class).

Automatically generated serializer is available via generatedSerializer() function in companion object of serializable class.

Keeping generated serializers allow to use plugin generated serializer in inheritors even if custom serializer is specified.

Used only with annotation Serializable with the specified argument Serializable.with, e.g. @Serializable(with=SomeSerializer::class).

Annotation is not allowed on classes involved in polymorphic serialization: interfaces, sealed classes, abstract classes, classes marked by Polymorphic.

A compiler version 2.0.20 or higher is required.