rjsf-team/react-jsonschema-form

oneOf + const enums do not use empty string title

Geschlossen

#4.448 geöffnet am 13.01.2025

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (2.136 Forks)batch import
any-one-all-ofbughelp wanted

Repository-Metriken

Stars
 (13.175 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 3T 17h) (32 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide