Skip to content

Swagger-UI can't render content inside a parameter #4442

@hazardfn

Description

@hazardfn
Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 3.0.0
Which Swagger-UI version? v3.13.4
How did you install Swagger-UI? standalone-dist
Which browser & version? Firefox 61.0a1
Which operating system? Mac Sierra

Demonstration API definition

Try and add a query parameter referencing an object (which according to the spec is a valid thing to do)

        - name: users
          in: query
          description: List of users to query for
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserArray"

components:
  schemas:

    UserArray:
      type: array
      items:
        $ref: "#/components/schemas/User"

    User:
      required:
        - userId
        - currency
      properties:
        userId:
          type: integer
          format: int32
        currency:
          type: string

Configuration (browser query string, constructor, config.yaml)

I am using no additional config options, everything is vanilla.

Expected Behavior

The UI should offer me a nice way of typing in arrays of objects in a query param. According to the documentation this should be possible:

in: query
name: coordinates
content:
  application/json:
    schema:
      type: object
      required:
        - lat
        - long
      properties:
        lat:
          type: number
        long:
          type: number

Current Behavior

Screen_Shot_2018_04_14_at_19_25_39

Context

Just an honest labourer trying to document a horrendous API I didn't write 🤣

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions