Skip to content

Commit 14566fb

Browse files
committed
fix: use to_json instead of JSON.dump because it generates different JSON when used in conjuction with other libraries (eg. Oj)
1 parent 64d770d commit 14566fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/pact/hal/link.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ def get(payload = {}, headers = {})
4141
end
4242

4343
def put(payload = nil, headers = {})
44-
wrap_response(href, @http_client.put(href, payload ? JSON.dump(payload) : nil, headers))
44+
wrap_response(href, @http_client.put(href, payload ? payload.to_json : nil, headers))
4545
end
4646

4747
def post(payload = nil, headers = {})
48-
wrap_response(href, @http_client.post(href, payload ? JSON.dump(payload) : nil, headers))
48+
wrap_response(href, @http_client.post(href, payload ? payload.to_json : nil, headers))
4949
end
5050

5151
def expand(params)

0 commit comments

Comments
 (0)