Json-Eclipse-Plugin
Json-Eclipse-Plugin copied to clipboard
Extra features/options for the formater
I'd like this features for the formatter (maybe others will too):
- don't indent/explode nested objects and arrays if they contain only one level
For something like:
{"a":1,"b":{"x":2,"y":3},"c":[4,5,6]}
instead of getting
{
"a": 1,
"b": {
"x": 2,
"y": 3
},
"c": [
4,
5,
6
]
}
get something like:
{
"a": 1,
"b": { "x": 2, "y": 3 },
"c": [ 4, 5, 6 ]
}
- don't indent more than n'th level
Es.
{"a":{"b":{"x":2,"y":3,"c":[4,5,6]}}}
, forn = 2
would give:
{
"a": {
"b": { "x": 2, "y": 3, "c": [ 4, 5, 6]}
}
}
Interesting idea! I will put it on my TODO list. If you want to have it soon, please free to implement and submit your code.
I'm a little too "rusty" with Java, I'm a python guy now. But I could give it a try, sounds like an interesting challenge.