davsclaus opened a new pull request, #28390: URL: https://github.com/apache/camel/pull/28390
## Summary _Claude Code on behalf of davsclaus_ [CAMEL-26115](https://issues.apache.org/jira/browse/CAMEL-26115): small bugs of the languages, found while adding their catalog body types (CAMEL-24961, #28389). This PR is stacked on #28389. - **python** (Jython): a script gives the Java value of its result instead of its Python text: - `None` is null, numbers and booleans stay Java numbers and Boolean, and a dict, list, tuple or set is a Map, List or Set of Java values. - A Java object such as the body is returned as it is. - An error while the script runs fails with `ExpressionEvaluationException`; a script that does not compile still fails with `ExpressionIllegalSyntaxException`. - **openfeature**: as an expression, a boolean flag gives its Boolean value, not the defaultValue as text with a TYPE_MISMATCH warning. - The string evaluation is retried as a boolean when the flag is not a string flag. - Number and object flags still give the defaultValue, and predicates are unchanged. - **datasonnet**: - `source` is used when the message body is null. - `matches()` no longer changes the output media type of the expression. - A stream body without a media type is read as text. - A null result gives null instead of a Document whose `${body}` failed with a NullPointerException, and a predicate on a null result is false. - **hl7terser**: a stream or a file body is read as an HL7 message, in the charset of MSH-18 as the data format does. Another body fails with an error that says what the body is, not a bare NullPointerException. - **ognl**: the documented `message` variable works (`RootObject.getMessage()`, as SpEL has). - **quickjs**: a Set, a Map and a typed array keep their values in the result. They are converted to an array, an object and an array of numbers before the result crosses into Java, also when nested; a result that needs no conversion is not copied. - **js and python3**: - An ArrayBuffer (js) and Python bytes, bytearray and memoryview (python3) give a `byte[]`, not a List of numbers. - A script that returns a function fails with "The script returned a function, which cannot be used after the script ends: return a value instead", instead of a value that failed when used later. The body types and the doc pages of these languages are updated to match, and the behavior changes are in the 4.24 upgrade guide. ## Test plan - [x] Every fix has a test that failed before it: - camel-datasonnet `DatasonnetBodyTest` - camel-hl7 `TerserExpressionBodyTest` - camel-python `PythonResultTest` - camel-ognl `OgnlTest` - camel-openfeature `OpenFeatureLanguageTest` - camel-quickjs `QuickjsSerializationTest` - camel-javascript `JavaScriptResultMaterializationTest` - camel-python3 `Python3LanguageEvalTest` - [x] The full test suites of the 8 modules pass. - [x] The catalog copies equal the module files, and the camel-catalog tests pass. 🤖 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]
