cloud-annotations / docusaurus-openapi

🦕 OpenAPI plugin for generating API reference docs in Docusaurus v2.
https://docusaurus-openapi.netlify.app
MIT License
498 stars 82 forks source link

oneOf doesn't work #244

Open jbojcic1 opened 1 year ago

jbojcic1 commented 1 year ago

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 commented 1 year ago

I see now this comment that seems to be related