Skip to content

Commit 2d8e8a4

Browse files
committed
Recognize JSON API response as JSON
Make sure we recognize `application/vnd.api+json` as JSON to pretty format it using `response_body_formatter`
1 parent 3878ba9 commit 2d8e8a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rspec_api_documentation/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def self.add_setting(name, opts = {})
110110
# See RspecApiDocumentation::DSL::Endpoint#do_request
111111
add_setting :response_body_formatter, default: Proc.new { |_, _|
112112
Proc.new do |content_type, response_body|
113-
if content_type =~ /application\/json/
113+
if content_type =~ /application\/.*json/
114114
JSON.pretty_generate(JSON.parse(response_body))
115115
else
116116
response_body

0 commit comments

Comments
 (0)