Skip to content

Invalid parameters are displayed in UI #7430

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

Open
mtovts opened this issue Jul 21, 2021 · 0 comments
Open

Invalid parameters are displayed in UI #7430

mtovts opened this issue Jul 21, 2021 · 0 comments

Comments

@mtovts
Copy link

mtovts commented Jul 21, 2021

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.

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

2 participants