redoc icon indicating copy to clipboard operation
redoc copied to clipboard

problem with generated text in oneOf buttons

Open mbj4668 opened this issue 2 years ago • 3 comments

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

mbj4668 avatar Apr 14 '22 11:04 mbj4668

Hi @mbj4668. Thank you for the issue. We'll investigate it.

AlexVarchuk avatar Apr 14 '22 14:04 AlexVarchuk

What happened to #1977 and the fix to this issue?

mbj4668 avatar Sep 01 '22 07:09 mbj4668

Hi @mbj4668, the https://github.com/Redocly/redoc/pull/1977 PR is not completed. This functionality should move to options for better backward compatibility.

AlexVarchuk avatar Sep 01 '22 07:09 AlexVarchuk