Skip to content

Commit

Permalink
ResourceBase call_operation as_jsons the body before attempting to JS…
Browse files Browse the repository at this point in the history
…ON.generate
  • Loading branch information
notEthan committed Apr 24, 2018
1 parent 85906cf commit 3d879d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scorpio/resource_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def call_operation(operation, call_params: nil, model_attributes: nil)
# if we have a body that's not a string and no indication of how to serialize it, we guess json.
request_headers['Content-Type'] = "application/json"
unless body.respond_to?(:to_str)
body = ::JSON.pretty_generate(body)
body = ::JSON.pretty_generate(Typelike.as_json(body))
end
elsif consumes.include?("application/x-www-form-urlencoded")
request_headers['Content-Type'] = "application/x-www-form-urlencoded"
Expand Down

0 comments on commit 3d879d4

Please sign in to comment.