annotation Crystalizer::Field
Overview
Annotations are similar to the stdlib's Serializable, but all features are not yet fully implemented.
struct Strukt
@[Crystalizer::Field(ignore: true, key: "Var")]
@var : Int32
end
Crystalizer::Field properties:
- ignore: if
trueskip this field in serialization and deserialization (by defaultfalse) - ignore_serialize: if
trueskip this field in serialization (by defaultfalse) - ignore_deserialize: if
trueskip this field in deserialization (by defaultfalse) - key: the value of the key in the json object (by default the name of the instance variable)