Skip to content

All of if then else warning #3445

@sercankavdir

Description

@sercankavdir

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    any-one-all-ofRelated to fixing anyOf, oneOf or allOfif-then-elseIssues related to handling JSON Schema if/then/elsepossibly closeTo confirm if this issue can be closedquestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions