How to exclude field only from serialization?

485 views Asked by At

Built value has an annotation for excluding certain field from serializing and deserializing. When a field is annotated with @BuiltValueField(serialize: false) it does not serialize nor deserialize. I want to achieve behaviour when the field is excluded from serialization but is included in deserialization to avoid making it nullable and hence unnecessary checks.

My solution now is to manually delete the field after deserialization which I found little bit ugly. I wounder if it's achivable by some other way.

0

There are 0 answers