Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow requests with extra_params and no parameters
Without this commit, the following request: post '/orders' do example_request 'should take an optional parameter hash', order_type: 'big' do ... end end would **not receive** the POST body/param `order_type: 'big'` specified. The reason is that the function `params` was returning nil if example.metadata[:parameters] was undefined, and the only one to define example.metadata[:parameters] was to have previously called "parameter". In other words, requests were not allowed to have so-called "extra parameters" unless they had at least one "parameter" specified. This commit removes this restrictions, allowing requests to specify all their parameters "inline".
- Loading branch information