JsonSurfer cannot parse boolean attributes
Closed this issue · 4 comments
adamsiemion commented
Given the following JSON
[{"a": true, "b": 1}, {"a": false, "b": 2}, {"a": false, "b": 3}]
and code
JsonSurferJackson.INSTANCE.collectAll(inputStream, "$[?(@.a==false)]")
JsonSurfer fails with
line 1:9 no viable alternative at input '@.a==false'
org.antlr.v4.runtime.misc.ParseCancellationException
at org.antlr.v4.runtime.BailErrorStrategy.recover(BailErrorStrategy.java:51)
...
Caused by: org.antlr.v4.runtime.NoViableAltException
wanglingsong commented
Sorry, JsonSurfer currently supports only number and quoted string in the filter clause. I will try to implement it in the next release.
adamsiemion commented
@wanglingsong thank you very much for the reply, any estimates when v1.4.4 can be released? i could really benefit from this feature.
wanglingsong commented
Hi, @adamsiemion I just implemented boolean comparison filter in the latest commit. You can try it by cloning from the source before official 1.4.4 release. BTW, I think your JsonPath was wrong, you should use "$[*][?(@.a==false)]" instead.
adamsiemion commented
@wanglingsong great stuff, thank you very much!