diff --git a/lib/batch_api/error_wrapper.rb b/lib/batch_api/error_wrapper.rb index 481d550..625daeb 100644 --- a/lib/batch_api/error_wrapper.rb +++ b/lib/batch_api/error_wrapper.rb @@ -27,7 +27,7 @@ def body # # Returns: an Array with the error body represented as JSON. def render - [status_code, RackMiddleware.content_type, [MultiJson.dump(body)]] + [status_code, RackMiddleware.content_type, [body.to_json]] end # Public: the status code to return for the given error. diff --git a/lib/batch_api/rack_middleware.rb b/lib/batch_api/rack_middleware.rb index 87a0177..f1e110e 100644 --- a/lib/batch_api/rack_middleware.rb +++ b/lib/batch_api/rack_middleware.rb @@ -10,7 +10,7 @@ def call(env) begin request = request_klass.new(env) result = BatchApi::Processor.new(request, @app).execute! - [200, self.class.content_type, [MultiJson.dump(result)]] + [200, self.class.content_type, [result.to_json]] rescue => err ErrorWrapper.new(err).render end