Skip to content

Can't use single quotes with Jackson, "in" predicate operator #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
johnflavin opened this issue Oct 20, 2016 · 3 comments
Closed

Can't use single quotes with Jackson, "in" predicate operator #275

johnflavin opened this issue Oct 20, 2016 · 3 comments
Labels

Comments

@johnflavin
Copy link

The README says, in section Filter Operators

String literals must be enclosed by single or double quotes ([?(@.color == 'blue')] or [?(@.color == "blue")]).

When using a JacksonJsonProvider or JacksonJsonNodeJsonProvider, and when testing a predicate with the in operator, an InvalidJsonException is thrown.

I've uploaded a test class to a gist: https://gist.github.com/johnflavin/31aea6ac790f32cbbb528124eceeb4df. In it, I try out all the different json provider classes, with single and double quotes, in predicates using ?(@.foo == 'bar') and ?(@.foo in ['bar']). Everything works as expected, except for Jackson providers, single quotes, and in.

@chb0github
Copy link

Use " double quotes

$.properties[?(@.name ==\ "driverContactId\").value

works for me

@johnflavin
Copy link
Author

I think you missed the point of the issue. I know that double quotes work. I know that == works. I provided a test class that tests this case and shows that it passes.

The only thing I am saying does not work is a predicate with a JacksonMappingProvider, using single quotes, and the in operator.

@kallestenflo
Copy link
Contributor

Works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants