Claus Ibsen created CAMEL-24970:
-----------------------------------
Summary: simple - catalog, documentation and syntax hint fixes
Key: CAMEL-24970
URL: https://issues.apache.org/jira/browse/CAMEL-24970
Project: Camel
Issue Type: Sub-task
Components: camel-core
Reporter: Claus Ibsen
Assignee: Claus Ibsen
Fix For: 4.23.0
SimpleConstants feeds simple.json, the TUI and the MCP tooling, so wrong
entries mislead users and AI agents.
* (verified) throwException argument order: SimpleConstants and
simple-functions.adoc document (type,msg), the code takes (msg,type). The
catalog example {{${throwException(java.io.IOException,'File not found')}}}
fails with ClassNotFoundException: File not found. The parse error text also
says (type,msg).
* (verified) HOST_NAME is "hostName" but the function is hostname.
* (verified) EXCEPTION_STACKTRACE is "exception.stackTrace"; the function is
exception.stacktrace and the documented spelling falls through to OGNL (returns
StackTraceElement[]).
* (verified) ASSERT marks msg optional but {{${assert(${body} == 'abc')}}} is a
parse error.
* SET_ATTACHMENT text is setVariable(key,exp) (copy-paste); NOT = "not" should
be not(exp); UUID omits the random kind; logExchange and sysenv are missing;
${date(now)} and ${bean(myBean)} examples do not parse.
* FileConstants descriptions start with a dagger character "†he" (leaks into
the catalog); *.noext.single description is wrong.
* Docs: pad direction backwards, file:modified returns Long not Date,
ceil/floor return long not int, substring negative-index wording,
substringBetween error message shows substringAfter.
* SimpleSyntaxHints: FUNCTIONS list is stale ({{${not}}} suggests ${sort}, avg
instead of average, many real functions missing so no suggestion);
trim/upper/lower aliases suggest bodyAs(String).trim() instead of ${trim()};
size -> length has different meaning; unexpectedToken also rewrites words
inside quotes. Consider generating the list from SimpleConstants.
_Claude Code on behalf of davsclaus (found by an AI review of the simple
language source; each item marked (verified) was reproduced on main at
c3ef718de2e8)_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)