Skip to main content
Use "type": "null" when a field must be present with a null value.

Example

null vs optional fields

  • type: "null": field is present and value is null.
  • Optional field: field may be absent.
  • Optional field + type: "null": field is either absent or present with null.
If you want a field that can be either string or null, use a union type: