Claus Ibsen created CAMEL-24906:
-----------------------------------

             Summary: camel-yaml-dsl-validator - the quote hints print the line 
to write, and a doubled closing quote says so
                 Key: CAMEL-24906
                 URL: https://issues.apache.org/jira/browse/CAMEL-24906
             Project: Camel
          Issue Type: Improvement
          Components: camel-yaml-dsl
            Reporter: Claus Ibsen
             Fix For: 4.23.0


After CAMEL-24888 the validator says "the value opens a double quote and never 
closes it" for a JSONPath written as

{code}
expression: "$[?(@.sku == '${header.sku}')]
{code}

and in the next stepwise run (series s7) the local model over-corrected to

{code}
expression: "$[?(@.sku == '${header.sku}')]""
{code}

seven times in one run of four examples, always the same line: the answer it 
got described the edit ("end it with a \" after the last character") instead of 
showing the line to write, and the second message ("the value of expression 
continues after its closing quote") describes concatenation, which is not what 
happened.

Two small changes, both in YamlValidator:

* the unclosed-quote hint prints the corrected line verbatim, {{expression: 
"$[?(@.sku == '${header.sku}')]"}}, so a model copies it instead of editing by 
description
* when the text after the closing quote is only a second quote, say so: "line 
N: the value of expression ends with two quotes; remove the extra one", instead 
of the concatenation message

A JSONPath with single quotes inside a double-quoted YAML scalar is the shape 
of every filter expression in the examples, so this line is written in almost 
every REST example.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to