Dhairya-007 opened a new pull request, #29953:
URL: https://github.com/apache/camel/pull/29953

   ## Problem
   
   The Simple language has four JSon output functions, in two pairs, and both 
halves of each pair carry the same `@Metadata` description:
   
   | function | description in `simple.json` |
   | --- | --- |
   | `toPrettyJson(exp)` | Converts the expression to JSon String 
representation. |
   | `toJson(exp)` | Converts the expression to JSon String representation. |
   | `toPrettyJsonBody` | Converts the body to JSon String representation. |
   | `toJsonBody` | Converts the body to JSon String representation. |
   
   `simple.json` is what tooling and editor completion read, so there the 
pretty variants and the plain ones are indistinguishable - the only hint is the 
`displayName`, `To Pretty JSon`.
   
   They do differ. `OutputFunctionFactory` builds the pretty pair with the 
pretty flag set:
   
   ```java
   remainder = ifStartsWithReturnRemainder("toPrettyJson(", function);
   ...
   return ExpressionBuilder.toJsonExpression(inlined, true);
   
   remainder = ifStartsWithReturnRemainder("toJson(", function);
   ...
   return ExpressionBuilder.toJsonExpression(inlined, false);
   ```
   
   and `simple-functions.adoc` already documents them as "serialized to JSON in 
pretty mode".
   
   ## Fix
   
   Say "pretty printed" in the description of `toPrettyJson(exp)` and 
`toPrettyJsonBody`. The regenerated `simple.json` files are included; 
`simple-functions.adoc` already distinguishes them and is unchanged.


-- 
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]

Reply via email to