davsclaus opened a new pull request, #29937: URL: https://github.com/apache/camel/pull/29937
Item 5 of [CAMEL-26929](https://issues.apache.org/jira/browse/CAMEL-26929) (JSON and output), the parts about the shape of the JSON. The ANSI codes in piped output are in #29924 (no ANSI codes when stdout is not a terminal). ## Problems and changes - **`pid` was text** in the JSON of `camel cmd trace` (status), `camel cmd browse` and `camel cmd logger`, and a number elsewhere. It is a number, with `JsonValues.pid` as in the other listings (now public, for the action commands). The JSON of these three commands is new in 4.24, so no released output changes. `camel cmd stub` had a number already. - **The rows of `camel get error --json`, `camel get history --json` and `camel top source --json` did not say which integration they are of.** They start with `pid` and `name` now, as the other listings; the rest of the row is as before. - **`camel get about --json` was an object for one integration and a list for more.** It is a list, also for one. Its JSON is new in 4.24. - **`--sort=age` of `camel get route` and `camel get route-group` sorted the youngest first**, the opposite of the listings of the integrations: those sort by when the integration started, and the uptime of a route is how long it runs. The routes now sort the oldest first too. The Javadoc of `RowSort.integration` said "how long the integration runs" while its callers pass the start time, and now says so. The JSON section of the exit codes page (`camel-jbang-exit-codes.adoc`) says that a list is a list also for one integration, and that a row of a listing has `pid` (a number) and `name`. Not in this PR: `uptime` stays a duration in the JSON of `get route` and `get route-group` (it is so since 4.23, and the TUI reads it), and "`name` is the file name in the action commands and the short name in the listings" needs its own look; `cmd send` and the trace dump have no `--json` yet. ## Tests - `ListErrorTest.testJsonOutput`, `CamelHistoryActionTest.testJsonOutputIsTheRecordedHistory`, `CamelSourceTopTest.jsonHasTheNumbersAndTheCode`: the rows have the `pid` and the `name`. - `CamelTraceActionTest.statusAsJson`: the `pid` is a number. - `ListAboutTest.asJson`: a list of one. - `CamelRouteStatusTest.sortByAgeIsTheOldestFirst` (new): a route that runs for 2 hours comes before one that runs for 5 seconds. - All six fail without the change. - camel-jbang-run: 303 pass. camel-jbang-core: 3003 + 259 pass (5 cases of `ExportTest` failed once and passed on the rerun, as on other branches). _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
