Skip to content

formats of query parameters are not shown for array-type parameters #4516

Description

@michalrus
Q A
Bug or feature request? bug
Which Swagger/OpenAPI version? any
Which Swagger-UI version? 3.14.0
How did you install Swagger-UI? dist/
Which browser & version? any
Which operating system? any

Demonstration API definition

{
  "swagger": "2.0",
  "paths": {
    "/v1/log/login/search": {
      "get": {
        "produces": [
          "application/json;charset=utf-8"
        ],
        "parameters": [
          {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "in": "query",
            "name": "targetUserIds",
            "collectionFormat": "multi",
            "type": "array",
            "description": "`UserId` | `uuid`"
          }
        ]
      }
    }
  }
}

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

{
  displayRequestDuration: true,
  tagsSorter: 'alpha',
  operationsSorter: 'alpha',
  showCommonExtensions: true,
  url: window.location.origin + "/swagger.json",
  dom_id: '#swagger-ui',
  deepLinking: true,
  presets: [
    SwaggerUIBundle.presets.apis,
    SwaggerUIStandalonePreset
  ],
  plugins: [
    SwaggerUIBundle.plugins.DownloadUrl
  ],
  layout: "StandaloneLayout"
}

No query string.

Expected Behavior

Array-type parameters’ formats being rendered somewhere.

Current Behavior

After #4245 and #4231, formats are shown correctly for non-array query parameters. However array ones get just array[string], which is not what is defined in the API above:

screenshot-20180504-142944

/cc @heldersepu @hkosova @shockey

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