I think I'd rather check for them, which IMO would be better than writing a key without a value to the JSON.

An argument could be made for defaulting to nil so this method could be called with fewer params, do you think that would be more flexible?