Redocly / Redocly/redoc

allOf refer to multiple oneOf, only one oneOf is kept

Open
#2,068 1 comment 1 reaction 1 assignee View on GitHub

@AlexVarchuk is already working on this.

Since Aug 1, 2022.

p2 Type: Bug
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

Describe the bug
When the items under the allOf are $ref to oneOf, only one of the oneOf is left in the merge result.

Expected behavior
In below example, the HTML output should includes two selectors, each one corresponding to an oneOf. And the properties list should have two properties.

Minimal reproducible OpenAPI snippet(if possible)

components:
  schemas:
    IdOrName:
        oneOf:
          - title: By ID
            properties:
              id:
                type: string
          - title: By Name
            properties:
              name:
                type: string
    AgeOrBirth:
        oneOf:
          - title: By Age
            properties:
              age:
                type: number
          - title: By Birth
            properties:
              birth:
                type: number
    DataA:
      allOf:
        - $ref: "#/components/schemas/IdOrName"
        - $ref: "#/components/schemas/AgeOrBirth"

Screenshots
Selection_042

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.