NeatJSON
NeatJSON copied to clipboard
neat formatting seems to ignore hash levels deeper than 2
the command to generate the below output is JSON.neat_generate(env, after_colon: 1, padding: 1). env contains the ruby hash object used to generate the output.
the output somehow has the _template hash all in one line, which is not expected:
{
"name": "foo",
"description": "some environment",
"cookbook_versions": {
...snip...
"seven_zip": "= 2.0.2",
"windows": "= 1.39.1",
"zookeeper": "= 9.0.1"
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
"blah": {
"_template": { "elb_logs_index_template": { "settings": { "number_of_shards": 6 } } }
}
},
"override_attributes": {}
}
the expected output is:
{
"name": "foo",
"description": "some environment",
"cookbook_versions": {
...snip...
"seven_zip": "= 2.0.2",
"windows": "= 1.39.1",
"zookeeper": "= 9.0.1"
},
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
"blah": {
"_template": {
"elb_logs_index_template": {
"settings": {
"number_of_shards": 6
}
}
}
}
},
"override_attributes": {}
}