Skip to content

docs: ps --format json outputs JSON Lines, not a JSON array#13868

Merged
glours merged 1 commit into
docker:mainfrom
glours:docs/ps-format-json-not-array
Jun 23, 2026
Merged

docs: ps --format json outputs JSON Lines, not a JSON array#13868
glours merged 1 commit into
docker:mainfrom
glours:docs/ps-format-json-not-array

Conversation

@glours

@glours glours commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What I did
Output was aligned with docker ps --format json in v2.21.0 (#10918) but the docs were never updated.

Related issue
Fixes #13850

(not mandatory) A picture of a cute animal, if possible in relation to what you did

Copilot AI review requested due to automatic review settings June 23, 2026 10:43
@glours glours requested a review from a team as a code owner June 23, 2026 10:43
@glours glours requested review from aevesdocker and ndeloof June 23, 2026 10:43
@glours glours self-assigned this Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the docker compose ps documentation to correctly describe --format json output as newline-delimited JSON (JSON Lines / NDJSON), matching the behavior introduced in v2.21.0 and aligning with docker ps --format json.

Changes:

  • Replace documentation claims/examples that showed a JSON array with JSON Lines output (one object per line).
  • Update the jq example/output to reflect streaming JSON objects rather than an array.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/reference/docker_compose_ps.yaml Updates the generated reference YAML examples to show JSON Lines output for --format json.
docs/reference/compose_ps.md Updates the rendered markdown reference to match JSON Lines behavior and adjusts the jq example accordingly.

@docker-agent docker-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

This documentation PR correctly updates the docker compose ps --format json description from "JSON array" to "JSON Lines (one JSON object per line)", aligning the docs with the actual behavior introduced in v2.21.0 (#10918).

What was reviewed:

  • docs/reference/compose_ps.md — updated description, added JSON Lines example, and jq . pretty-print example
  • docs/reference/docker_compose_ps.yaml — corresponding YAML reference updated consistently

Findings: No bugs or factual errors found. The two files are consistent with each other. The JSON Lines examples are technically accurate. The jq . output correctly shows two separate JSON objects (as jq would emit them from a JSON Lines stream). The alignment claim with docker ps --format json is accurate.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@glours glours enabled auto-merge (rebase) June 23, 2026 13:03
Output was aligned with `docker ps --format json` in v2.21.0 (docker#10918)
but the docs were never updated.

Fixes docker#13850

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
@glours glours force-pushed the docs/ps-format-json-not-array branch from b810ba8 to f4ec4a9 Compare June 23, 2026 13:55
@glours glours merged commit 3d0dd57 into docker:main Jun 23, 2026
78 of 79 checks passed
@glours glours deleted the docs/ps-format-json-not-array branch June 23, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Docs about 'docker compose ps --format json' is wrong

3 participants