Closed f3ath closed 1 year ago
Where do you see that it "must" be escaped?
JSONPath copied the grammar for strings from JSON (adding single-quoted strings as an extra).
JSON allows escaping slash characters (for cultural compatibility with the way JavaScript is included in <script
elements in HTML).
Escaping slashes never is needed to create correct JSON.
Making use of the ability to escape slashes is convenient if the JSON text is then somehow used as JavaScript in an HTML <script
element, which is probably no longer a significant way we use JSON texts.
Thank you. I misread the spec.
As per 2.3.1, the forward slash (
/
) must be escaped with a\
in name selectors. What are the reasons for this requirement?