facet classafJson::JsonProperty
sys::Obj afJson::JsonProperty : sys::Facet
Marks a field as a property of a JSON object.
- defVal
const Obj? defValWhen converting to JSON, any Fantom value that equals this
defValwill be treated as if it werenulland (depending onObjConverter) will not exist in the JSON object.When converting from JSON, any
nullvalue will be converted to thisdefVal.This is most useful for saving marker booleans and to avoid saving empty lists and maps.
- implType
const Type? implTypeThe implementation
Typeto be instantiated should this field reference a mixin or a superclass. Used when mapping from JSON objects to Fantom objects.For dynamic typing evaluated at runtime, use a field named
_type:@JsonProperty Type _type := this.typeof
Defaults to the field type.
- name
const Str? nameName of the JSON property name this field maps to.
Defaults to the field name.