Closed f3ath closed 1 year ago
If you store a JSONPath query in a JSON text, you have to apply JSON rules, including escaping of backslashes. That is not governed by JSONPath, but by your usage of JSON.
Within a JSONPath string literal, you will need to escape backslashes. String literals are one of the ways of supplying arguments to a function.
So the combination of your use of JSON to store JSONPath queries and the JSONPath rules for string literals make me believe that Option 2 is what you want.
No further discussion; I gather this issue is addressed.
I was not able to find where the spec defines the rules for string literals in function arguments. The spec requires certain character to be escaped (and treated accordingly) in name selectors, but are there similar requirements for function arguments?
E.g. if I want to define a new test in the CTS, what's the correct way:
Option 1. String literals do NOT require escaping backslash, so I only need to escape it in JSON:
Option 2. String literals DO require escaping backslashes, so I need to account for that: