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

Mutiple typeIds [not, oneOf] matched in subschema #52

Open
joakim-ronning opened this issue Jan 23, 2024 · 1 comment
Open

Mutiple typeIds [not, oneOf] matched in subschema #52

joakim-ronning opened this issue Jan 23, 2024 · 1 comment
Labels

Comments

@joakim-ronning
Copy link

joakim-ronning commented Jan 23, 2024

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

@sagold sagold added the bug label Mar 28, 2024
@sagold
Copy link
Owner

sagold commented Mar 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants