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

oneOf doesn't work #244

Open
jbojcic1 opened this issue Apr 4, 2023 · 1 comment
Open

oneOf doesn't work #244

jbojcic1 opened this issue Apr 4, 2023 · 1 comment

Comments

@jbojcic1
Copy link

jbojcic1 commented Apr 4, 2023

Seems like schema with oneOf is not properly handled. I have the swagger.json which looks something like this:

"/v1/something": {
      "post": {
        "tags": ["Something"],
        "summary": "Create something",
        "description": "This some description",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/TypeA"
                  },
                  {
                    "$ref": "#/components/schemas/TypeB"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TypeC"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": ["some.scope"]
          }
        ]
      }
    },

but it results in an empty body:

Screenshot 2023-04-04 at 12 58 27

@jbojcic1
Copy link
Author

jbojcic1 commented Apr 4, 2023

I see now this comment that seems to be related

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

No branches or pull requests

1 participant