I still don't see why it would be a problem merging then down even when used like an either. If there is no value then there is no value.
{}
and { "foo": null }
and { "foo": 42 }
So I'll represent that (in e.g. Rust) as: struct Whatever {
foo: Option<Option<u32>>,
}
None means not present, Some(None) means present but null, and Some(Some(42)) means present with a value.I'll often use this in PATCH endpoints, where not-present means to leave the current value alone, null means to unset it, and a value means to set to that value.