[
https://issues.apache.org/jira/browse/CAMEL-25392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-25392.
---------------------------------
Resolution: Fixed
Merged in https://github.com/apache/camel/pull/27915 (commit 7d66aecff880):
with --json, stdout is exactly one JSON document, also when the command fails
(an error document with the exit code, [] for an empty list); the broken --json
cases are fixed, and doctor, validate, doc, config get/list and plugin get/list
have --json. The --json of the data-returning cmd actions moved to CAMEL-25393.
_Claude Code on behalf of davsclaus (Claus Ibsen)_
> camel-jbang - JSON output contract
> ----------------------------------
>
> Key: CAMEL-25392
> URL: https://issues.apache.org/jira/browse/CAMEL-25392
> Project: Camel
> Issue Type: Sub-task
> Components: camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.24.0
>
>
> * {{JsonOutput}} helper: exactly one JSON document on stdout; lists print
> {{[]}} when empty; errors print
> {{\{"status":"error","code":N,"message":...\}}} on stdout and exit with the
> same code (plain {{ERROR:}} also on stderr).
> * Fix broken {{--json}}: {{top route}}, {{top group}} (print a table), {{get
> health --trace}}, {{get route --error}}, {{infra run}}, {{infra get}}/{{infra
> stop}} (ignored), {{version list}} (ERROR line before JSON breaks MCP
> VersionTools), {{overview --save/--ai}}, catalog no-match text.
> * Add {{--json}} to {{doctor}} (OK/WARN/FAIL per check), {{validate}} (same
> {{\{status,file,errors[]\}}} shape as MCP camel_validate_source), {{doc}},
> {{config get/list}}, {{plugin list}}, and data-returning {{cmd}} actions.
> _Claude Code on behalf of davsclaus (Claus Ibsen)_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)