rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.
https://rjsf-team.github.io/react-jsonschema-form/
Apache License 2.0
14.03k stars 2.18k forks source link

All of if then else warning #3445

Closed sercankavdir closed 1 month ago

sercankavdir commented 1 year ago

Prerequisites

What theme are you using?

core

What is your question?

Link to Playground

{
  "type": "array",
  "title": "List",
  "items": {
    "type": "object",
    "properties": {
      "key": {
        "title": "Key",
        "type": "string",
        "format": "string",
        "enum": [
          "iapItem",
          "bundle"
        ]
      }
    },
    "allOf": [
      {
        "if": {
          "properties": {
            "key": {
              "const": "iapItem"
            }
          }
        },
        "then": {
          "properties": {
            "value": {
              "type": "string",
              "title": "iap",
              "enum": [
                "a",
                "b"
              ],
              "enumNames": [
                "asd",
                "bnm"
              ]
            }
          }
        }
      },
      {
        "if": {
          "properties": {
            "key": {
              "const": "bundle"
            }
          }
        },
        "then": {
          "properties": {
            "value": {
              "type": "string",
              "title": "bundle",
              "enum": [
                "c",
                "d"
              ],
              "enumNames": [
                "cvb",
                "dfg"
              ]
            }
          }
        }
      }
    ]
  }
}

Using version: 4.2.3 but also have the same issue with v5.1.0 I am facing with the issue of: could not merge subschemas in allOf: Error: Could not resolve values for path:"properties.value.enum". They are probably incompatible. Values: [ "a", "b" ] [ "c", "d" ] It always gives the same warning even in the playground in the console

heath-freenome commented 1 year ago

@sercankavdir It appears that the library we are using isn't really supporting if/then/else yet.

stale[bot] commented 2 months ago

This issue has been automatically marked as possibly close because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.

stale[bot] commented 1 month ago

This issue was closed because of lack of recent activity. Reopen if you still need assistance.