camunda / feel-scala

FEEL parser and interpreter written in Scala
https://camunda.github.io/feel-scala/
Apache License 2.0
119 stars 46 forks source link

string() function wraps a string into a string value #747

Closed saig0 closed 8 months ago

saig0 commented 8 months ago

Describe the bug If I invoke the string() function with a string argument, the function wraps the string into another string. As a result, the string value is escaped.

This behavior is different compared to previous versions of the FEEL engine (i.e. a regression).

The wrapped string value is complicated to handle because I need to unwrap it before using it.

To Reproduce Steps to reproduce the behavior:

  1. Evaluate the expression
    string("foo")
  2. Verify that the result is a string wrapped inside a string
    "\"foo\""

Expected behavior If I invoke the string() function with a string value, it should return the string value as it is (i.e. no wrapping, no escaping).

string("foo")        => "foo"

Related DMN-TCK test case 0079-feel-string-function.

Environment