klogg icon indicating copy to clipboard operation
klogg copied to clipboard

Scratchpad function Format Json does not handle Json arrays

Open FrankKlappe opened this issue 3 years ago • 1 comments

I tried formatting the following json:

[{"ReceiptLines": [{"LineNumber": 1}],"Description": ""}]

This results in:

{ "Description": "", "ReceiptLines": [ { "LineNumber": 1 } ] }

Expected:

[ { "ReceiptLines": [ { "LineNumber": 1 } ], "Description": "" } ]

FrankKlappe avatar Jun 23 '22 10:06 FrankKlappe

Thanks for reporting this. That is a side effect of being able to process these text:

some date | log level | {"ReceiptLines": [{"LineNumber": 1}],"Description": ""}

It looks for first valid json object and extracts it. So top level arrays are indeed broken.

variar avatar Jun 23 '22 10:06 variar

Can be tested in 23.06.0.1500+

variar avatar Jul 01 '23 11:07 variar