rjsf-team/react-jsonschema-form

Description Property Not Shown in OneOf Dropdown Menu 🐛

Closed

#4214 aperta il 10 giu 2024

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)TypeScript (2136 fork)batch import
bughelp wanted

Metriche repository

Star
 (13.175 star)
Metriche merge PR
 (Merge medio 3g 17h) (32 PR mergiate in 30 g)

Descrizione

Prerequisites

What theme are you using?

core

Version

5.18.4

Current Behavior

When using the description property in a oneOf subSchema, it isn't rendered under the dropdown menu.

{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "oneOf": [
        {
          "const": "vcluster",
          "title": "Virtual cluster plan",
          "description": "This is a virtual cluster plan."
        },
        {
          "const": "coab",
          "title": "Cloud-on-a-bench plan",
          "description": "This is a cloud-on-a-bench plan."
        },
        {
          "const": "kamaji",
          "title": "Kamaji plan",
          "description": "This is a Kamaji plan."
        }
      ]
    }
  }
}

image

Expected Behavior

We should see a text field under the dropdown selection menu that dynamically changes the description of the selected field, similar to how it works for objects :

{
  "type": "object",
  "oneOf": [
    {
      "title": "Small",
      "description": "Small plan",
      "type": "object"
    },
    {
      "title": "Big",
      "description": "Big plan",
      "type": "object"
    }
  ]
}

image

Steps To Reproduce

No response

Environment

- OS: Ubuntu 22
- Node: 20.11.1
- npm: 10.2.4

Anything else?

No response

Guida contributor