I am using chilkat library for many year and for many aspect. where JSON is one of the things i used regularly.
and instead of compact JSON output, i prefer/use pretty format.
here is how the output from Chilkat.JSON library looks like:
{
"AdvancedObject": { //new/starting braces should be in new line
"BoolTest": 1,
"IntTest": 1234567890,
"LongTest": 1234567890123456789,
"DoubleTest": 74.26,
"DateTimeTest": "2015-10-12 10-20-30",
"StringTest": "Oh man! just a string it is!!",
"EnumTest": "Good",
"ChildObject": { //new/starting braces should be in new line
"Left": 12.21,
"Top": 34.43,
"Width": 123.45,
"Height": 567.89
},
"ListString": [ //array of non-object items should be in single line
"Salma Begum",
"Abul Hossen",
"Kamrul Hassan",
"Minul Hassan",
"Imran Hassan"
],
"ListInt": [ //array of non-object items should be in single line
0,
1,
2,
3,
4,
5,
6,
7,
8,
9
],
"ListAdvanced": [ //new/starting braces should be in new line
{
"Left": 12.21,
"Top": 34.43,
"Width": 123.45,
"Height": 567.89
},
{
"Left": 12.21,
"Top": 34.43,
"Width": 123.45,
"Height": 567.89
},
{
"Left": 12.21,
"Top": 34.43,
"Width": 123.45,
"Height": 567.89
}
]
}
}
but i expect the following format, which can be get by using JSTool Plugin In Notepad++? which i like to get using c# and/or Chilkat.JSON library.
{
"AdvancedObject":
{
"BoolTest": 1,
"ChildObject":
{
"Height": 567.89,
"Left": 12.21,
"Top": 34.43,
"Width": 123.45
},
"ColorTest": "0, 128, 255",
"DateTimeTest": "2015-10-12 10-20-30",
"DoubleTest": 74.26,
"EnumTest": "Good",
"IntTest": 1234567890,
"ListAdvanced": [
{
"Height": 567.89,
"Left": 12.21,
"Top": 34.43,
"Width": 123.45
},
{
"Height": 567.89,
"Left": 12.21,
"Top": 34.43,
"Width": 123.45
},
{
"Height": 567.89,
"Left": 12.21,
"Top": 34.43,
"Width": 123.45
}
],
"ListInt": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
"ListString": ["Salma Begum", "Abul Hossen", "Kamrul Hassan", "Minul Hassan", "Imran Hassan"],
"LongTest": 1234567890123456789,
"StringTest": "Oh man! just a string it is!!"
}
}
please don’t suggest me to use any other/additional library to include/reference. Because i am using chilkat for many others things, and don’t want to use another JSON library just to pretty format.
thanks in advance
best regards