From 14566fb978b1a2f2a7c3660f1f79ee70792dc9d1 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Wed, 4 Sep 2019 16:54:36 +0800 Subject: [PATCH] fix: use to_json instead of JSON.dump because it generates different JSON when used in conjuction with other libraries (eg. Oj) --- lib/pact/hal/link.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pact/hal/link.rb b/lib/pact/hal/link.rb index 6b5b20f4..0494b9b4 100644 --- a/lib/pact/hal/link.rb +++ b/lib/pact/hal/link.rb @@ -41,11 +41,11 @@ def get(payload = {}, headers = {}) end def put(payload = nil, headers = {}) - wrap_response(href, @http_client.put(href, payload ? JSON.dump(payload) : nil, headers)) + wrap_response(href, @http_client.put(href, payload ? payload.to_json : nil, headers)) end def post(payload = nil, headers = {}) - wrap_response(href, @http_client.post(href, payload ? JSON.dump(payload) : nil, headers)) + wrap_response(href, @http_client.post(href, payload ? payload.to_json : nil, headers)) end def expand(params)