Incorrect JSON encoding with Oj
Using Oj for encoding JSON results in hash keys being prepended with a :
Example:
require "oj"
require "httpx"
HTTPX.with(debug: STDERR, debug_level: 2).post("https://nghttp2.org/httpbin/post", json: {a: 1})
...
1: -> DATA: 8 bytes...
1: -> "{\":a\":1}"
...
This happens because Oj.dump by default is not compatible with JSON.dump, and to make it behave the same you need to pass a compatibility mode in the options hash as a second argument: Oj.dump(obj, mode: :compat)