NPP-JSONViewer / JSON-Viewer

A JSON viewer plugin for Notepad++. Displays the selected JSON string in a tree view.
MIT License
751 stars 150 forks source link

Error when formatting multiple JSON objects #96

Open rennerg opened 3 years ago

rennerg commented 3 years ago

Would it be possible to have this plugin support multiple JSON objects? To illustrate, the plugin cannot handle this:

{"@timestamp":"2021-01-07T15:42:18.0187523+00:00","level":"Information","messageTemplate":"Sending HTTP request {HttpMethod} {Uri}","message":"Sending HTTP request "POST" http://workflow-manager/v1/WorkflowDefinitions/name/WD-contouring-process/instances","fields":{"HttpMethod":"POST","Uri":"http://workflow-manager/v1/WorkflowDefinitions/name/WD-contouring-process/instances","EventId":{"Id":100,"Name":"RequestStart"},"SourceContext":"System.Net.Http.HttpClient.IWorkflowDefinitionsClient.ClientHandler","Scope":["HTTP POST http://workflow-manager/v1/WorkflowDefinitions/name/WD-contouring-process/instances"]}}
{"@timestamp":"2021-01-07T15:42:18.0965985+00:00","level":"Information","messageTemplate":"Received HTTP response after {ElapsedMilliseconds}ms - {StatusCode}","message":"Received HTTP response after 77.8249ms - Created","fields":{"ElapsedMilliseconds":77.8249,"StatusCode":"Created","EventId":{"Id":101,"Name":"RequestEnd"},"SourceContext":"System.Net.Http.HttpClient.IWorkflowDefinitionsClient.ClientHandler","HttpMethod":"POST","Uri":"http://workflow-manager/v1/WorkflowDefinitions/name/WD-contouring-process/instances","Scope":["HTTP POST http://workflow-manager/v1/WorkflowDefinitions/name/WD-contouring-process/instances"]}}

The "Show JSON Viewer" is only able to parse the first object in the viewer. The "Format JSON" just throws a parsing error and formats nothing.

Could this be a quick enhancement?

CanyonCasa commented 3 years ago

FYI, for interested parties this is referred to as streaming JSON. More info at... https://en.wikipedia.org/wiki/JSON_streaming