You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As indicated in PaesslerAG/jsonpath#38, Gval has trouble evaluating some JSONPath expressions since its syntax in that point conflicts with Go syntax:
Strings in Go are portrayed by double-quotes "..." and as
raw-strings ... . Single-quoted-strings '...' are not known in Go. Instead, they are used to indicate single characters and runes. This means, when Gval encounters single-quotes strings, it will try to parse it as a single character and fail, throwing an error.
This is because Gval uses the text/scanner as is. To solve this issue, there could be an option to allow for alternate parsing, which would take single quotes or similar into account. Instead of the text/scanner package, a custom, similar lexer could be used.
Addtionally, the strconv.Unquote functionality is also based on Go, and as such will not accept single-quoted strings. As such, the parseString-method could be adjusted as well, so that it transforms single-quoted strings into double-quoted strings, allowing them to be parsed.
These changes could be made optional as to not disrupt potential workflows that already depend on jsonpath not evaluating single quoted strings.
The text was updated successfully, but these errors were encountered:
As indicated in PaesslerAG/jsonpath#38, Gval has trouble evaluating some JSONPath expressions since its syntax in that point conflicts with Go syntax:
Strings in Go are portrayed by double-quotes "..." and as
raw-strings
...
. Single-quoted-strings '...' are not known in Go. Instead, they are used to indicate single characters and runes. This means, when Gval encounters single-quotes strings, it will try to parse it as a single character and fail, throwing an error.This is because Gval uses the text/scanner as is. To solve this issue, there could be an option to allow for alternate parsing, which would take single quotes or similar into account. Instead of the text/scanner package, a custom, similar lexer could be used.
Addtionally, the strconv.Unquote functionality is also based on Go, and as such will not accept single-quoted strings. As such, the parseString-method could be adjusted as well, so that it transforms single-quoted strings into double-quoted strings, allowing them to be parsed.
These changes could be made optional as to not disrupt potential workflows that already depend on jsonpath not evaluating single quoted strings.
The text was updated successfully, but these errors were encountered: