SerialInfo
Meta-annotation that commands the compiler plugin to handle the annotation as serialization-specific. Serialization-specific annotations are preserved in the SerialDescriptor and can be retrieved during the serialization process with SerialDescriptor.getElementAnnotations for properties annotations and SerialDescriptor.annotations for class annotations.
It is recommended to explicitly specify a target for serial info annotations, whether it is AnnotationTarget.PROPERTY, AnnotationTarget.CLASS, or both. Other targets are not supported and will cause a compiler warning. Explicitly specifying the target(s) will help to avoid accidental behavior change if support for new targets is added in the future.
Keep in mind that Kotlin compiler prioritizes function parameter target over property target, so serial info annotations used on constructor-parameters-as-properties without explicit declaration-site or use-site target are not preserved.