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

Path parameters are not correctly overriden #400

Closed
axnsan12 opened this issue Jan 9, 2018 · 1 comment
Closed

Path parameters are not correctly overriden #400

axnsan12 opened this issue Jan 9, 2018 · 1 comment

Comments

@axnsan12
Copy link

axnsan12 commented Jan 9, 2018

Hello,

According to the swagger specification, parameters can be defined both at the operation level and at the path item level, where parameters redeclared in Operation must override the ones in the path.

Redoc currently fails to handle this, and displays both parameters.

Example spec:

swagger: '2.0'
info:
  title: Path parameter test
  version: v1
paths:
  '/snippets/{id}/':
    delete:
      operationId: snippetsDelete
      description: delete method docstring
      parameters:
        - name: id
          in: path
          description: Operation-level parameter override
          required: true
          type: string
      responses:
        '204':
          description: ''
      consumes:
        - application/json
      tags:
        - snippets
    parameters:
      - name: id
        in: path
        description: Path-level parameter
        required: true
        type: integer

Result:

image

If you paste the example on https://editor.swagger.io/, you will see that it is handled correctly.

@RomanHotsiy
Copy link
Member

@axnsan12 good catch! thanks. Will be fixed in the upcoming release

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

No branches or pull requests

2 participants