Skip to content

oneOf + const enums do not use empty string title #4448

@nickgros

Description

@nickgros

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

We can define an enum with oneOf:

{
      "oneOf": [
        {
          "const": "empty",
          "title": ""
        },
        {
          "const": "active"
        }
      ]
}

But if the title is an empty string, the const value is used.

Expected Behavior

The empty string option is used instead of falling back to the const value.

Steps To Reproduce

Playground link

Environment

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions