Description
Hello,
This issue is pretty much for reporting the incompatibility to the gem author, and hopefully it will help anyone who runs into this problem to understand what's going on.
Basically, after we upgrade our dependencies to use Rack 2.1.1, we noticed that our generated documentation no longer show JSON response but instead showing [binary data]
instead.
Digging in further, we found out that in rack/rack@8c62821, especially this change, MockResponse#body
now creates a buffer and use <<
to join the content together. However, on line 195, the author uses String.new
without specifying the encoding, resulting in Ruby creating a new String with ASCII-8BIT
encoding by default.
As it turns out, rspec_api_documentation relies on string encoding to determine if it should include the response body in the documentation or not:
rspec_api_documentation/lib/rspec_api_documentation/client_base.rb
Lines 90 to 95 in 560c3bd
Hence, the change in Rack broke this conditional.
I've reported this issue to Rack in rack/rack#1486, and hopefully we can solve this soon.
The solution right now for us is to lock Rack to ~> 2.0.8
for now.
Thank you very much.