I often write the following
json.object([
#("foo", json.nullable(x, json.int)
])
Which will create {foo: null} when x is None. What I often want is {} when x is null several API's in the wild crash if an optional field is instead sent with a value of null.
A possible implementation was suggested in #31 though it's not clear this is the best PR.
I often write the following
Which will create
{foo: null}when x isNone. What I often want is{}when x is null several API's in the wild crash if an optional field is instead sent with a value of null.A possible implementation was suggested in #31 though it's not clear this is the best PR.