Skip to content

Commit

Permalink
Merge pull request #367 from timurvafin/json-api-format
Browse files Browse the repository at this point in the history
Recognize JSON API response as JSON
  • Loading branch information
oestrich authored Jan 9, 2018
2 parents 3878ba9 + 2d8e8a4 commit 4cfef51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def self.add_setting(name, opts = {})
# See RspecApiDocumentation::DSL::Endpoint#do_request
add_setting :response_body_formatter, default: Proc.new { |_, _|
Proc.new do |content_type, response_body|
if content_type =~ /application\/json/
if content_type =~ /application\/.*json/
JSON.pretty_generate(JSON.parse(response_body))
else
response_body
Expand Down

0 comments on commit 4cfef51

Please sign in to comment.