Skip to content

Commit

Permalink
Include delete request parmeters in generated documentation
Browse files Browse the repository at this point in the history
One of my API routes allows multiple objects to be deleted.  In routing, it
looks like this:

```ruby
  resources :posts do
    collection do
        delete :destroy
      end
  end
```

The generated examples from tests did not include the parameters.  This patch
treats :DELETE like PUT/POST/PATCH and includes the parameters in the generated
examples
  • Loading branch information
johnnaegle authored and iNecas committed Feb 1, 2017
1 parent 16144d7 commit 529eb91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/apipie/extractor/recorder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def analyze_functional_test(test_context)
@verb = request.request_method.to_sym
@path = request.path
@params = request.request_parameters
if [:POST, :PUT, :PATCH].include?(@verb)
if [:POST, :PUT, :PATCH, :DELETE].include?(@verb)
@request_data = @params
else
@query = request.query_string
Expand Down

0 comments on commit 529eb91

Please sign in to comment.