Code:
require 'json'
puts "With empty hash"
puts JSON.pretty_generate({})
puts "With empty hash in child"
puts JSON.pretty_generate({"empty": {}})
Output: jruby -v hello.rb
jruby 9.4.0.0 (3.1.0) 2022-11-23 95c0ec159f Java HotSpot(TM) 64-Bit Server VM 25.202-b08 on 1.8.0_202-b08 +jit [x86_64-darwin]
With empty hash
{
}
With empty hash in child
{
"empty": {
}
}
The indentation is incorrect.
CC: @headius