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

BUG: failing to fetch examples for parameters #10121

Open
ThePrimeJnr opened this issue Sep 6, 2024 · 0 comments
Open

BUG: failing to fetch examples for parameters #10121

ThePrimeJnr opened this issue Sep 6, 2024 · 0 comments

Comments

@ThePrimeJnr
Copy link

Q&A (please complete the following information)

  • OS: ArchLinux
  • Browser: chrome
  • Version: 127.0.6533.99 (Official Build) (64-bit)
  • Method of installation: Swagger editor
  • Swagger-UI version: 3.10.0
  • Swagger/OpenAPI version: OpenAPI 3.1.0

Content & configuration

Example Swagger/OpenAPI definition:

  /api/resource/User:
    get:
      tags:
        - user
      summary: "Get All Users"
      description: "Retrieve a list of all User records."
      parameters:
        - name: fields
          in: query
          description: "Comma-separated list of fields to include in the response."
          schema:
            type: string
            examples: 
              - 'field'

Describe the bug you're encountering

Swagger UI doesn't use example or parameter when using the examples key (as an array). I got it to work using the deprecated example

To reproduce...

Steps to reproduce the behavior:

  1. write a sample swagger yaml in swagger editor
  2. add a path and add a param field.
  3. add example example to the properties and you can see the example value.
  4. replace with examples as an array and you'd lose the example value

Expected behavior

should be able to render the example vaue when using examples

Screenshots

image
image

Additional context or thoughts

Willing to attempt fixing this - if it gets approved to be a bug

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

No branches or pull requests

1 participant