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

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

Open
michalrus opened this issue May 4, 2018 · 1 comment
Open

Comments

@michalrus
Copy link

michalrus commented May 4, 2018

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

@scottohara
Copy link
Contributor

Just to add to this, it appears that the following options relating to collectionFormat are currently not displayed either:

  • minItems
  • maxItems
  • uniqueItems

When considering how best to visually represent different collectionFormat styles in the <ParameterRow> component, these options may also influence the design.

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

No branches or pull requests

3 participants