ietf-wg-jsonpath / draft-ietf-jsonpath-base

Development of a JSONPath internet draft
https://ietf-wg-jsonpath.github.io/draft-ietf-jsonpath-base/
Other
58 stars 20 forks source link

Clarify syntax of strings in match and search regexp arguments #367

Closed glyn closed 1 year ago

glyn commented 1 year ago

Currently the spec doesn't make it completely clear whether regexp strings need to be enclosed in double quotes or whether single quotes are also acceptable.

My reading of the normative parts of the current spec is that the arguments need to be enclosed in double quotes because they must be of type Value. If this is the intention, we should provide an example showing single quotes are not allowed. Currently, there is an example showing that single quotes are allowed.

gregsdennis commented 1 year ago

This seems related to #362. That issue concluded that strings in expressions, including those passed into functions, can be single- or double-quoted, just like in name selectors.

My reading of the normative parts of the current spec is that the arguments need to be enclosed in double quotes because they must be of type Value.

Where are you seeing this?

The ABNF says

function-argument       = filter-path / comparable

and comparable just includes string-literal which uses either single- or double-quotes.

I expect that regex strings should match requirements of any other string.

glyn commented 1 year ago

Thanks @gregsdennis. On reflection, I think the spec is clear as is.