Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All of if then else warning #3445

Open
1 task done
sercankavdir opened this issue Feb 16, 2023 · 1 comment
Open
1 task done

All of if then else warning #3445

sercankavdir opened this issue Feb 16, 2023 · 1 comment
Labels
any-one-all-of Related to fixing anyOf, oneOf or allOf if-then-else Issues related to handling JSON Schema if/then/else question

Comments

@sercankavdir
Copy link

sercankavdir commented Feb 16, 2023

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

@sercankavdir sercankavdir added needs triage Initial label given, to be assigned correct labels and assigned question labels Feb 16, 2023
@heath-freenome
Copy link
Member

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

@heath-freenome heath-freenome added any-one-all-of Related to fixing anyOf, oneOf or allOf if-then-else Issues related to handling JSON Schema if/then/else and removed needs triage Initial label given, to be assigned correct labels and assigned labels Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
any-one-all-of Related to fixing anyOf, oneOf or allOf if-then-else Issues related to handling JSON Schema if/then/else question
Projects
None yet
Development

No branches or pull requests

2 participants