jsonata-java icon indicating copy to clipboard operation
jsonata-java copied to clipboard

$string must escape special chars in field names

Open aeberhart opened this issue 2 months ago • 1 comments

Input

$string({"te\nst":"te\nst"})

Output

{"te
st":"te\nst"}

Expected

{"te\nst":"te\nst"}

aeberhart avatar Oct 29 '25 19:10 aeberhart

re-applying $eval() to the result of $string manages to parse the illegal JSON this expression causes an error though:

{"te\nst":"te\nst"} ~> |$|{}| Expected valid string character at 1:5

aeberhart avatar Oct 30 '25 07:10 aeberhart