docker / cli

The Docker CLI
Apache License 2.0
4.77k stars 1.89k forks source link

Parsing individual json objects into json array #5052

Closed arankeparth closed 2 months ago

arankeparth commented 2 months ago

- What I did Added commas between individual json objects and then added brackets around them to make an array.

- How I did it Read each line from the buffer then added comma and finally added brackets.

- How to verify it

- Description for the changelog Parsing individual json objects into json array

arankeparth commented 2 months ago

This is a slightly dirty fix. please suggest some changes if possible!

thaJeztah commented 2 months ago

This would be a breaking change; the current output is line-delimited JSON, which most tools would be able to handle already.

neersighted commented 2 months ago

I'm going to close this for now; not only is this an undesired breaking change (the output here has always intentionally been JSON lines), but kludging an array together using string manipulation (instead of changing the serialization code) is not a sensible way to make this change even if it was desired.