Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with generated text in oneOf buttons #1960

Open
mbj4668 opened this issue Apr 14, 2022 · 3 comments
Open

problem with generated text in oneOf buttons #1960

mbj4668 opened this issue Apr 14, 2022 · 3 comments
Labels
investigation openapi Questions about specification, validity, and edge cases p3 Type: Bug

Comments

@mbj4668
Copy link

mbj4668 commented Apr 14, 2022

Describe the bug
Tested on fd8917e.

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
@AlexVarchuk
Copy link
Collaborator

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

@mbj4668
Copy link
Author

mbj4668 commented Sep 1, 2022

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

@AlexVarchuk
Copy link
Collaborator

Hi @mbj4668, the #1977 PR is not completed. This functionality should move to options for better backward compatibility.

@Oprysk Oprysk added the p3 label Sep 5, 2022
@lornajane lornajane added the openapi Questions about specification, validity, and edge cases label Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation openapi Questions about specification, validity, and edge cases p3 Type: Bug
Projects
None yet
Development

No branches or pull requests

4 participants