Open
Description
Currently, refmt:
- Will decode null to a zero value (i.e.,
MyStruct{}
) - Can be instructed to skip zero values when encoding by specifying "omitempty".
However, there isn't a way to say "encode zero values to null" (the inverse of 1). This can be useful when we always want to have a field present in an object but would like to make it clear that the field is empty.
Specifically, this would be really useful for CIDs in IPLD. Users can currently specify "omitempty" but, if they fail to include this, encoding a zero-value CID will return an error. With some way to say "encode the zero value to null", this would "just work".
Proposal: Add a Nullable(nullable bool)
option to the atlas entry builder.
Metadata
Metadata
Assignees
Labels
No labels