Claus Ibsen created CAMEL-26484:
-----------------------------------
Summary: camel-jbang - AI tools: a JsonPath or SpEL filter in
Simple, a jsonpath text that is not a path, {id} for a path parameter and json
as a language are caught at write time
Key: CAMEL-26484
URL: https://issues.apache.org/jira/browse/CAMEL-26484
Project: Camel
Issue Type: Improvement
Components: camel-jbang, camel-yaml-dsl
Reporter: Claus Ibsen
Fix For: 4.24.0
In the r25 run of the local-model benchmark (qwen3.6 35B on Ollama),
contracts-rest-code-first step 1 (answer one order by its id, or 404) passed in
2 of 7 rounds, against 5 of 7 in r24. The validator accepted routes that then
failed on every request:
- A SpEL or JsonPath filter inside Simple, such as {{$\{body[?(@.orderId ==
'$\{header.id\}')]\}}}: Simple reads it as a method or a key.
- A jsonpath text with the words of the List message copied into it:
{{$[?(...)] \{resultType: java.util.Map\}}} (InvalidPathException).
- {{\{id\}}} in a jsonpath text: the literal text, not the path parameter, so
every id got 404.
- The JSON answer of the 404 under {{json:}}, told "did you mean 'js'?" 4 times.
What changes, at write time:
- A JsonPath or SpEL filter inside a Simple function is reported, with the
jsonpath step that picks the element, as YAML lines.
- The text of a jsonpath expression is read as a path. Text after the path, a
bracket or a quote that is not closed, and a JSON text are reported, with the
lines to write. The JsonPath library is not added to the CLI, so the check is
light, and it reports only what the JsonPath compiler refuses.
- {{\{id\}}} in a simple, constant or jsonpath text, or in a log message, is
reported when a REST operation with the path parameter id reaches the route:
the path parameter is the header {{$\{header.id\}}}.
- json: under expression: says that json is a data format, not a language, and
gives the JSON text with constant, or simple when it has $\{...\}.
- The List message (CAMEL-26386) gives the jsonpath step as YAML lines, with
expression: and resultType: as two keys.
The new checks report nothing on the reference files of the benchmark steps, on
the YAML examples of the simple, jsonpath and REST DSL docs, or on the 1238
right final versions of the r24 and r25 runs.
_Filed by Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)