Skip to content

Commit

Permalink
fix: use to_json instead of JSON.dump because it generates different …
Browse files Browse the repository at this point in the history
…JSON when used in conjuction with other libraries (eg. Oj)
  • Loading branch information
bethesque committed Sep 4, 2019
1 parent 64d770d commit 14566fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pact/hal/link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 14566fb

Please sign in to comment.