docusaurus-openapi icon indicating copy to clipboard operation
docusaurus-openapi copied to clipboard

oneOf doesn't work

Open jbojcic1 opened this issue 2 years ago • 1 comments

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 avatar Apr 04 '23 10:04 jbojcic1

I see now this comment that seems to be related

jbojcic1 avatar Apr 04 '23 11:04 jbojcic1