davsclaus opened a new pull request, #26621:
URL: https://github.com/apache/camel/pull/26621
## Description
Three findings of the round-2 local-model benchmark on the
camel-jbang-examples ladder, each hit by a person the same way.
**CAMEL-24839, camel-file.** `from: file:order.json`, a regular file where
the component expects a directory, started and stayed silent (the same with
`pollEnrich`). The consumer is now refused when it is created:
```
order.json is a file, not a directory: the file component reads the files of
a directory. To read this one file use file:.?fileName=order.json (as from:, or
with pollEnrich)
```
**CAMEL-24840, YAML validator.** `dataFormatProperty: [- prettyPrint:
"true"]` answered "property 'prettyPrint' is not defined in the schema" and
nothing about the item form. Every key/value property list of
`restConfiguration` (dataFormatProperty, componentProperty, endpointProperty,
consumerProperty, apiProperty, corsHeaders) now says: *an item of
dataFormatProperty is a key and a value: - key: prettyPrint followed by value:
"..." (indented under the -)*.
**CAMEL-24841, camel-jsonpath and the validator.** `$.status == 'paid'` in a
`when` failed with Jayway's "Use bracket notion ['my prop'] if your property
contains blank characters". The easy predicate parser turns `status == 'paid'`
into a filter but skipped anything starting with `$` as a regular path, so the
natural form with the root never worked. Now:
- as a predicate, `$.status == 'paid'` is parsed to `$[?(@.status ==
'paid')]` and `$.store.book.price < 10` to `$.store.book[?(@.price < 10)]`; a
filter or a plain path is untouched, and nothing that worked before changes
(the rooted comparison used to throw);
- where a path is expected (setBody, setHeader, split), the runtime message
and a new `JsonPathChecks` in the CLI and camel-jbang-mcp validation say it is
a comparison, not a path, and give the filter form and the Simple form
(`${body[status]} == 'paid'`). The path is compiled on the first evaluation, so
the hint is added there; a comparison in a `when` or `filter` is not reported.
`EasyPredicateOperators.hasOperator` becomes public for the expression
class; nothing else in the API changes.
## Tests
- camel-core `FileConsumeFileAsDirectoryTest`; the file consumer tests
around it still pass.
- validator `YamlValidatorPropertyHintTest` (+1), module tests 67 green.
- camel-jsonpath `EasyPredicateParserTest` (with and without a root, regular
paths kept), `EasyJsonPathWithRootPathCBRTest` (a content-based router on real
JSON, and the hint on an expression); the whole module 127 green.
- camel-jbang-core `JsonPathChecksTest` (expression, condition, paths and
filters); the `commands.ai` package green.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
--
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]