Redocly / Redocly/redoc

problem with generated text in oneOf buttons

Open
#1,960 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
Tested on fd8917e5.

I get the following "One of" buttons with three oneOf:

image

The behavior of the buttons is as expected, but not the labels on the buttons.

I expected that the first oneOf's buttons would be obj1-A and obj1-B,
the second obj2-A and obj2-B, and the third obj3-A and obj3-B.

Like this:

image
(this is w/ a single oneOf instead of allOf)

Here's the full spec:

openapi: 3.0.3
info:
  version: "1.0"
  title: My API
servers:
  - url: https://localhost:4646
paths:
  /xx:
    post:
      summary: test
      responses:
        200:
          description: ok
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/myobj"
components:
  schemas:
    myobj:
      allOf:
        - type: object
          properties:
            name:
              type: string
        - type: object
          oneOf:
            - type: object
              title: obj1-A
              properties:
                foo1:
                  type: string
            - type: object
              title: obj1-B
              properties:
                bar1:
                  type: string
        - type: object
          oneOf:
            - type: object
              title: obj2-A
              properties:
                foo2:
                  type: string
            - type: object
              title: obj2-B
              properties:
                bar2:
                  type: string
        - type: object
          oneOf:
            - type: object
              title: obj3-A
              properties:
                foo3:
                  type: string
            - type: object
              title: obj3-B
              properties:
                bar3:
                  type: string

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

The issue provides a complete OpenAPI 3.0.3 reproduction; start by loading it in Redoc and tracing the generated oneOf button labels across the three allOf entries. Done means each pair is labeled obj1-A/obj1-B, obj2-A/obj2-B, and obj3-A/obj3-B while button behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.