Skip to main content

Required and nullable properties

The Lune API, as a general rule, uses nulls to describe properties that are not defined.

Requests, which take resources with null properties, allow clients to omit those properties for convenience.

nullable properties in requests are not-required.


Responses, however, never omit null properties.

null properties in responses are required.

Patch requests

PATCH requests behave as follows:

  • If a property within a resource is set to null, the property is deleted
  • If a property within a resource is not set, the property is unaltered
  • Request
  • {
      "id": "34e9a1c3e12fc0a45d08b4a956a626a16862230b",
      "required_property": "foo"
    }
    // or
    {
      "id": "34e9a1c3e12fc0a45d08b4a956a626a16862230b",
      "required_property": "foo",
      "optional_property": null
    }
  • Response
  • {
      "id": "34e9a1c3e12fc0a45d08b4a956a626a16862230b",
      "required_property": "foo",
      "optional_property": null // is never omitted
    }