Extendable

@Target(allowedTargets = [AnnotationTarget.CLASS])
@SerialInfo
annotation class Extendable

To be used with kotlinx.serialization.Serializable. Allows serialized classes to be extended by adding members with default initializers to the end of the constructor list.

This annotation makes Bipack to insert fields count before the serialized data. It then checks it on deserializing to fill not serialized fields will default values.

Note that since 0.0.7 the same behavior could be achieved by serializing each instance in the array as Bipack correctly processes end-of-data by filling missing fields with default values, using Extendable is more convenient and save some space, most of the time.

Please note that without this annotation it could be impossible to deserialize old versions of the class, in particular, in array, inner fields, etc.