Claus Ibsen created CAMEL-24854:
-----------------------------------
Summary: camel-yaml-dsl-validator - the hint for a backslash in
double quotes copies the doubled backslash into single quotes, where it becomes
a literal backslash
Key: CAMEL-24854
URL: https://issues.apache.org/jira/browse/CAMEL-24854
Project: Camel
Issue Type: Bug
Components: camel-yaml-dsl
Reporter: Claus Ibsen
For a value with an escape the YAML parser rejects, such as
{code:yaml}
include: ".*\\.json$"
{code}
the validator says: {{\\. inside double quotes is an escape character and . is
not one; write the value in single quotes: '.*\\.json$'}}. The rewrite copies
the double-quoted text verbatim, but inside single quotes YAML does not process
backslashes: {{'.*\\.json$'}} is the regex {{.*\\.json$}}, which matches a file
name containing a literal backslash, so no file matches. In the round-2
benchmark (series l3) the model followed the hint and the route ran ten seconds
in silence, the worst kind of failure.
The rewrite in {{YamlValidator.unknownEscape}} must unescape a doubled
backslash ({{\\\\}} to {{\\}}) when moving the value to single quotes, so the
hint reads {{write the value in single quotes: '.*\\.json$'}} with one
backslash. A test next to the existing one for the hint.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)