1

I'm using JsonPath to check matches of some json-paths against a JSON document with a SpringBoot application.

It gives the following exception when I include in operator inside the expression. But the same jsonpath expression works fine online. I tried debug inside jayway code as well but had no luck in finding a resolution.

com.jayway.jsonpath.InvalidPathException: com.jayway.jsonpath.InvalidPathException: Space not allowed in path

JSON payload:

{
     "color": "red",
     "price": 19.95
}

jsonpath expression:

$.[?(@.color in ['red','blue'])]
Michał Ziober
  • 37,175
  • 18
  • 99
  • 146
  • 2
    Which version of library do you use? I checked it with `2.4.0` and it works fine for given `JSON` and `path expression`. – Michał Ziober Mar 13 '19 at 21:57
  • 1
    @MichałZiober: Thanks for your response. Yes it works fine with the latest version. It was silly that I didn't try a version upgrade. (for the reference of anyone who might experience the same issue, I got the specified error with version 2.0.0) – Bhanuka Withana Mar 14 '19 at 04:37

0 Answers0