Skip to content

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

Open
@dcdh

Description

@dcdh

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions