Skip to content

I'd like a nicer api to create objects without null properties #32

Description

@CrowdHailer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThe approach has not yet been decided

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions