Sitelet https://github.com/cloud-annotations/docusaurus-openapi/issues/244
Skip to content

oneOf doesn't work #244

Description

@jbojcic1

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions