Claus Ibsen created CAMEL-24845:
-----------------------------------
Summary: Simple: the suggestion for ${jsonpath:$.status} is the
same text (did you mean ${jsonpath:$.status}?); the function is
${jsonpath($.status)}
Key: CAMEL-24845
URL: https://issues.apache.org/jira/browse/CAMEL-24845
Project: Camel
Issue Type: Bug
Components: camel-jbang, camel-core
Reporter: Claus Ibsen
Writing a jsonpath inside Simple the way the other functions with a colon are
written:
{code:yaml}
- filter:
simple: "${jsonpath:$.status} == 'paid'"
{code}
{{camel validate yaml}} and the runtime answer
{code}
Line 8: Simple syntax error: Unknown function: jsonpath:$.status (did you mean
${jsonpath:$.status}?)
{code}
The suggestion is the text that was rejected, so the reader (and a model, three
attempts in a row in the round-2 benchmark, filter-and-multicast) keeps writing
it. The working form is the function call: {{${jsonpath($.status)}}} (verified
on 4.23.0-SNAPSHOT, logs "paid"). The suggestion logic that wraps an unknown
function in ${} should recognise the {{name:arg}} shape for the functions that
take their argument in parentheses (jsonpath, jq, xpath, bean?) and suggest
{{${jsonpath($.status)}}}, with the same for the other languages Simple can
embed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)