Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that JSON format is actually JSON lines format #1191

Open
MattDodsonEnglish opened this issue May 29, 2023 · 0 comments
Open

Document that JSON format is actually JSON lines format #1191

MattDodsonEnglish opened this issue May 29, 2023 · 0 comments
Labels
Tech Writers Issues that a writer could help with Type: Bug Something doesn't work how it should

Comments

@MattDodsonEnglish
Copy link
Contributor

MattDodsonEnglish commented May 29, 2023

The JSON is output is not really JSON, but JSON lines. Proper JSON would be enclosed in square brackets with each item in the array separated by commas. The JSON lines format just puts all objects on its own line.

The implication is that a little pre-processing needs to be done to be usable by something like node's readFile. Jq could do it with jq -s '.' ./result.json > result-array.json.

As I understand, JSON lines makes it possible to stream the output, so the output has advantages. But, the correct format should be documented in the JSON output page.

Related k6 issue: grafana/k6#737

@MattDodsonEnglish MattDodsonEnglish added Type: Bug Something doesn't work how it should Tech Writers Issues that a writer could help with labels May 29, 2023
@MattDodsonEnglish MattDodsonEnglish changed the title Document that json format is actually JSON lines format Document that JSON format is actually JSON lines format May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tech Writers Issues that a writer could help with Type: Bug Something doesn't work how it should
Projects
None yet
Development

No branches or pull requests

1 participant