json-schema-library icon indicating copy to clipboard operation
json-schema-library copied to clipboard

Mutiple typeIds [not, oneOf] matched in subschema

Open joakim-ronning opened this issue 1 year ago • 1 comments

Hello,

I'm trying to add the OpenAPI 3.0 schema to one of my projects using Draft04, but I'm running into an error I cannot comprehend.

Error:

Mutiple typeIds [not, oneOf] matched in {...}

Offending sub-schema:

"SchemaXORContent": {
        "description": "Schema and content are mutually exclusive, at least one is required",
        "not": {
          "required": [
            "schema",
            "content"
          ]
        },
        "oneOf": [
          {
            "required": [
              "schema"
            ]
          },
          {
            "required": [
              "content"
            ],
            "description": "Some properties are not allowed if content is present",
            "allOf": [
              {
                "not": {
                  "required": [
                    "style"
                  ]
                }
              },
              {
                "not": {
                  "required": [
                    "explode"
                  ]
                }
              },
              {
                "not": {
                  "required": [
                    "allowReserved"
                  ]
                }
              },
              {
                "not": {
                  "required": [
                    "example"
                  ]
                }
              },
              {
                "not": {
                  "required": [
                    "examples"
                  ]
                }
              }
            ]
          }
        ]
      }

If this is expected, are there any known solutions?

Best regards

joakim-ronning avatar Jan 23 '24 15:01 joakim-ronning

Sorry for the late reply. To me it looks like not in conjunction with oneOf is unsupported. I will need to investigate this. The only possible workaround for now might be a change of the schema.

sagold avatar Mar 28 '24 09:03 sagold