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

how to display a list of exemples from swagger ui for application/x-www-form-urlencoded #10051

Open
dcdh opened this issue Jun 30, 2024 · 0 comments

Comments

@dcdh
Copy link

dcdh commented Jun 30, 2024

Q&A (please complete the following information)

  • OS: Linux
  • Browser: Firefox
  • Version: 127.0.2
  • Method of installation: [e.g. npm, dist assets]
  • Swagger-UI version: [e.g. 3.10.0]
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0]

Content & configuration

I am using the new online swagger editor https://editor-next.swagger.io/

Swagger/OpenAPI definition:

openapi: 3.0.3
info:
  title: Example API
  version: 1.0.0
paths:
  /example:
    post:
      summary: Redefine limits
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - newColdLimit
                - newWarmLimit
              properties:
                newColdLimit:
                  type: string
                  description: New Cold limit to redefine
                  example: "22"
                newWarmLimit:
                  type: string
                  description: New Warm limit to redefine
                  example: "40"
            examples:
              redefineOk:
                summary: Successful redefinition
                value: newColdLimit=22&newWarmLimit=40
              coldLimitNegative:
                summary: Redefinition fail because new cold limit is negative
                value: newColdLimit=-22&newWarmLimit=40
              warmLimitNegative:
                summary: Redefinition fail because new warm limit is negative
                value: newColdLimit=22&newWarmLimit=-40
              warmBelowCold:
                summary: Redefinition fail because new warm limit is below cold limit
                value: newColdLimit=40&newWarmLimit=22
      responses:
        '200':
          description: Successful operation
        '400':
          description: Invalid input

Swagger-UI configuration options:

SwaggerUI({
  // your config options here
})
?yourQueryStringConfig

Screenshots

How can we help?

How can I display a list of examples when trying the request under swagger ui ?

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