whyrusleeping / cbor-gen

Codegen for cbor codecs on your types
MIT License
35 stars 25 forks source link

Overwrite all fields when decoding, even if the value is null #21

Closed Stebalien closed 4 years ago

Stebalien commented 4 years ago

Currently, if a value is null, we'll won't set the field in the struct to null. This means a re-used object could end up with merged state.

Stebalien commented 4 years ago

Alternatively, we could check to see if the struct is empty and refuse to decode into it if not?