Skip to content

Null Type Not Working With Enum #4422

@aress31

Description

@aress31

Prerequisites

What theme are you using?

mui

Version

5.x

Current Behavior

When defining a property with an enum, e.g.:

{
  "schema": {
    "type": "object",
    "definitions": {
      "status": {
        "enum": ["active", "cancelled", "completed", "inactive", "pending"]
      }
    },
    "properties": {
      // --- SNIP ---
      "status": {
        "type": ["string", "null"],
        "$ref": "#/definitions/status"
      },
      // --- SNIP ---
    }
  },
  "uiSchema": {
    // --- SNIP ---
  }
}

Null values are still not accepted, see:

image

Expected Behavior

No response

Steps To Reproduce

No response

Environment

Latest everything.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions