zipmark/rspec_api_documentation

Query parameters definition not being appended to the URL

Opened this issue · 0 comments

Hi,

I am using the gem with the api_blueprint format and I am having trouble with the query params definition.

For example I define an endpoint like:

route '/v1/some_model', '' do
  get 'Returns the list' do
    parameter :page, 'Page number', { type: :number, example: 3, required: false }

    ...
  end
end

And What I get is:

Some model resource

## Some model endpoints [/v1/some_model]

+ Parameters
  + page: 3 (optional, integer) - Page number

### Returns the list [GET]

...

But what I should get is:

Some model resource

## Some model endpoints [/v1/some_model{?page}]

+ Parameters
  + page: 3 (optional, integer) - Page number

### Returns the list [GET]

...

This subtle difference makes the parameters invisible when you use a tool like Apiary.

Thanks!