stoplightio / json-schema-viewer

A JSON Schema viewer React component
Apache License 2.0
175 stars 37 forks source link

Show title instead of any for combiners #223

Closed BelfordZ closed 1 year ago

BelfordZ commented 1 year ago

Context

Consider the schema:

{
  "title": "a",
  "oneOf": [
    {
      "title": "b",
      "type": "object",
      "properties": {
        "c": {
          "title": "d",
          "type": "string"
        },
        "e": {
          "title": "e",
          "type": "string"
        }
      }
    },
    {
      "title": "f",
      "type": "boolean"
    },
    {
      "title": "g",
      "oneOf": [
        {
          "title": "h",
          "type": "string"
        },
        {
          "title": "l",
          "type": "object",
          "properties": {
            "foo": {
              "title": "k",
              "oneOf": [
                {
                  "title": "m",
                  "type": "string"
                },
                {
                  "title": "o",
                  "type": "object",
                  "properties": {
                    "foo": { "type": "string" }
                  }
                }
              ]
            }
          }
        }
      ]
    }
  ]
}

Current Behavior

Displays any inplace of g in the choices dropdown: image

in the schema row image

Expected Behavior

Displays g inplace of any in the choices dropdown: image

in the schema row image

Possible Workaround/Solution

Steps to Reproduce

  1. copy the schema at the top into a fixture

Environment