rjsf-team/react-jsonschema-form

oneOf + const enums do not use empty string title

Fechada

#4.448 aberto em 13 de jan. de 2025

 (0 comentário) (0 reação) (0 responsável)TypeScript (2.136 forks)batch import
any-one-all-ofbughelp wanted

Métricas do repositório

Stars
 (13.175 estrelas)
Métricas de merge de PR
 (Mesclagem média 3d 17h) (32 fundiu PRs em 30d)

Description

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

Guia do colaborador