In reference to #1989 (sorry, I have commented in there before I realised the issue was closed).
I'm having exactly the same issue.
If this is used:
env['api.format'] = :binary # or :txt
content_type 'application/json' # or header 'Content-Type', 'application/json'
{key: 123}.to_json
Then it still calls the JSON formatter. If the content_type
method is left off, it doesn't.
Here is an example using grape-on-rack:
https://github.com/waynerobinson/grape-on-rack
Please take a look at the extra methods added to Acme::Ping
.
The only one that doesn't call the JSON formatter is the one where the content type is set to text/plain
.