Skip to content

Invalid parameters are displayed in UI #7430

Open
@mtovts

Description

@mtovts

Q&A (please complete the following information)

  • OS: [e.g. macOS] Windows
  • Browser: [e.g. chrome, safari] Firefox
  • Version: [e.g. 22] 90.0
  • Method of installation: [e.g. npm, dist assets] app.swaggerhub.com
  • Swagger-UI version: [e.g. 3.10.0] don't see
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] OpenAPI 3.0.3

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.3
info:
  title: Parameters example
  version: 1.0.0
servers:
  - url: 'https://127.0.0.1/api/rest'
paths:
  '/foo/{bar}':
    post:
      parameters:
        - name: bar
          in: header
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: string
      responses:
        '200':
          description: Example
          content:
            application/json:
              schema:
                type: string
    delete:
      responses:
        '200':
          description: OK
    parameters:
      - required: true
        name: bar
        in: path
        schema:
          type: string

Swagger-UI configuration options:

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

Describe the bug you're encountering

Specification says A unique parameter is defined by a combination of a name and location.

I defined bar parameter in path location at PathItem and I defined parameter with same name bar, in header location at Operation.

To reproduce...

Steps to reproduce the behavior:

  1. Go to app.swaggerhub.com.
  2. Register and create new API.
  3. Paste OpenAPI yaml from the example (above).
  4. See error in POST method: One parameter bar in header location displayed. No bar in path location parameter.

Expected behavior

Expected two parameters in POST method: bar in path location and foo in header location.

Screenshots

Additional context or thoughts

Related question in OpenAPI-Specification repo.

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