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

Swagger-UI 5.1.0: Example Value box displayed for Response Object with only description. #8975

Open
Teraskull opened this issue Jun 30, 2023 · 4 comments

Comments

@Teraskull
Copy link

Q&A (please complete the following information)

  • Swagger-UI version: 5.1.0
  • Swagger/OpenAPI version: OpenAPI 3.1

Looks similar to #5453.
Does not happen on Swagger-UI 4.

If I have a response object like this, with only description, it shows an Example Value box with "string" value:

401:
    description: Unauthorized

image

On Swagger-UI 4 only the description is visible, without the Example Value box.

Not sure if this is a regression or an intended feature.

@Teraskull
Copy link
Author

Any workarounds? Seems like a regression to me

@Teraskull
Copy link
Author

@char0n this change is undocumented?

@char0n
Copy link
Member

char0n commented Aug 17, 2023

I'd say it's a regression. If the Response Object.content field is not defined or is defined but doesn't contain schema we shouldn't render anything; except for the case where example or examples fields are explicitly defined on Media Type Object.

@bweben
Copy link

bweben commented Mar 8, 2024

responses:
        "200":
          description: "OK"
          content:
            '*/*':
              schema:
                $ref: "#/components/schemas/SchemaObjectDefinition"

As I understand you @char0n correctly, this should display an example value and not just "string"?
Sadly, we still have the issue that "string" is displayed instead of the Object as the example. The same example works the same on here https://editor.swagger.io/.
We use the version 5.11.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants