Grape::Formatter::Json.instance_eval<<-EOF
def call(object, env)
if object.is_a?(Hash)
JSON.pretty_generate(object)
else
if object.respond_to?(:to_json)
j = object.to_json
JSON.pretty_generate( JSON.parse(j))
else
JSON.pretty_generate( object)
end
end
end
EOF