Redocly / Redocly/redoc

Multiple oneOf tags not rendering 2.0.0-alpha.29

Open
#569 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am using "redoc": "2.0.0-alpha.29".

I have pasted a stripped down version of my api that shows what is happening. I was expecting both sets of choices (the oneOfs) from RequestObject to be rendered, but instead I only get Single Piece Identifier and (IdentifierPart1 and IdentifierPart2). There should be another "One Of" line with another set of buttons for the choice in "ObjectWithAnotherOneOf", and "OtherThing" should be rendered all the time. Nothing from ObjectWithAnotherOneOf is being rendered.

I hope this is clear enough of an example!

openapi: 3.0.1
info:
  version: 0.0.1
  title: My RESTful API
servers:
- url: /blah
  description: Development server running locally
paths:
  /thing1:
    post:
      tags:
        - Thing1
      summary: Thing1
      description: All about Thing1
      operationId: api.thing1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestObject'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseObject'
components:
  schemas:
    ObjectWithAnotherOneOf:
      allOf:
        - oneOf:
          - $ref: '#/components/schemas/Detail2'
          - $ref: '#/components/schemas/Detail1'
        - $ref: '#/components/schemas/OtherThing'
    OtherThing:
      type: object
      properties:
        details:
          type: string
          description: Placeholder for minimum reproduction
    IdentifierPart1:
      type: object
      properties:
        part1:
          type: string
    IdentifierPart2:
      type: object
      properties:
        part2:
          type: string
    IdentifierPart2Identifier:
      oneOf:
        - $ref: '#/components/schemas/SinglePieceIdentifier'
        - allOf:
          - title: IdentifierPart1 and IdentifierPart2
          - $ref: '#/components/schemas/IdentifierPart1'
          - $ref: '#/components/schemas/IdentifierPart2'
    SinglePieceIdentifier:
      type: object
      title: SinglePieceIdentifier
      properties:
        myIdentifier:
          type: string
    RequestObject:
      allOf:
        - $ref: '#/components/schemas/IdentifierPart2Identifier'
        - $ref: '#/components/schemas/ObjectWithAnotherOneOf'
        - $ref: '#/components/schemas/AnotherDataPiece'
    ResponseObject:
      type: object
      properties:
        details:
          type: string
          description: Placeholder for minimum reproduction
    AnotherDataPiece:
      type: object
      properties:
        dataPiece:
          type: string
    Detail1:
      type: object
      title: Detail 1
      properties:
        detail1:
          type: boolean
          description: Placeholder for minimum reproduction
    Detail2:
      type: object
      title: Detail 2
      properties:
        detail2:
          type: boolean
          description: Placeholder for minimum reproduction
  securitySchemes:
    bearerAuth:
      description: >
        All services must use this method of authentication after a
        successful [Login](#operation/login)
      type: http
      scheme: bearer
      bearerFormat: JWT
security:
  - bearerAuth: []


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.

Research direction

Start by reproducing the supplied OpenAPI schema in Redoc 2.0.0-alpha.29 and trace the rendering path for nested oneOf and allOf schemas. Done means both oneOf choice groups are rendered and OtherThing appears alongside the selected structures.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.