JsonField

@Target(allowedTargets = [AnnotationTarget.FIELD])
annotation class JsonField(val name: String = "", val ignore: Boolean = false, val deserializer: KClass<out Deserializer<*>> = Deserializer::class)

Annotation for marking a field to be serialized to and deserialized from JSON.

Properties

Link copied to clipboard
val deserializer: KClass<out Deserializer<*>>

Specifies a custom Deserializer to use for this field. The deserializer must be a subclass of Deserializer.

Link copied to clipboard
val ignore: Boolean = false

Indicates whether this field should be ignored during serialization or deserialization.

Link copied to clipboard
val name: String

Specifies the name of the JSON field. If left empty, the field name will be used by default.