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

Route parameters are duplicated when explicitly documented #393

Open
mroach opened this issue Aug 21, 2018 · 4 comments
Open

Route parameters are duplicated when explicitly documented #393

mroach opened this issue Aug 21, 2018 · 4 comments

Comments

@mroach
Copy link

mroach commented Aug 21, 2018

This may only affect OpenAPI/Swagger. When you document a route parameter, the parameter output is duplicated.

RSpec.resource "rspec_api_documentation duplicate parameter bug" do
  get "/test/:id/:cmd" do
    parameter :id, "ID of the user", in: :path
    parameter :cmd, "Command", in: :path

    example_request "works like a charm" do
      expect(status).to eq 200
    end
  end
end

Output (truncated to relevant parts):

"/test/{id}/{cmd}": {
  "get": {
    "tags": [
      "rspec_api_documentation duplicate parameter bug"
    ],
    "parameters": [
      {
        "name": "id",
        "in": "path",
        "description": "ID of the user",
        "required": true,
        "type": "string"
      },
      {
        "name": "cmd",
        "in": "path",
        "description": "Command",
        "required": true,
        "type": "string"
      },
      {
        "name": "id",
        "in": "path",
        "description": "",
        "required": true,
        "type": "string"
      },
      {
        "name": "cmd",
        "in": "path",
        "description": "",
        "required": true,
        "type": "string"
      }
    ],
    "responses": {  }
  }
}
@SrMouraSilva
Copy link

The next release will be includes a solution

@c13e
Copy link

c13e commented May 27, 2019

Looks like the fix was merged in master but is not yet included in the current release of the gem.

Any plans for including this fix in an upcoming release @oestrich? Thanks

@mtancoigne
Copy link

I used master, and the issue seems to persist...

@Sabantu
Copy link

Sabantu commented Jun 29, 2022

@oestrich is it possible to include the fix for the issue in a new version?

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

5 participants