Open tlaundal opened 6 years ago
While it might not do everything you described, we already have a system to hide defaults:
Reflected#setDefault
I cannot remember if you can directly call addInheritedField
& removeInheritedField
directly too.
Can those defaults be used in custom converters? Or in MapNode?
I've come in quite a few cases where I wish only the fields that differ from the default value in the class is saved.
For instance, if I have a section that has a type property, and some fields are only relevant to one type, or if I just have a lot of fields, and the default values will be fine for many of them in most cases.
It should still be possible to force some fields to be saved, but that could be done with an annotation. Or we could go the other way and annotate fields that only should be hidden if they have the default value.