I'm trying to use jsonpath like $[?(@.payId == 154)] to extract element from json [ { "payId":154, "amount":100 }, { "payId":155, "amount":150 }, { "payId":null, "amount":500 } ]
but I get
File "/usr/local/lib/python3.6/site-packages/jsonpath_rw_ext/_filter.py", line 80, in find value = int(value)
since python can not convert None to int
Possible solution for this problem is to add None value check before type conversion section in _filter.py
This method worked for me (my fork).
I'm trying to use jsonpath like
$[?(@.payId == 154)]
to extract element from json[ { "payId":154, "amount":100 }, { "payId":155, "amount":150 }, { "payId":null, "amount":500 } ]
but I getFile "/usr/local/lib/python3.6/site-packages/jsonpath_rw_ext/_filter.py", line 80, in find value = int(value)
since python can not convertNone
toint
Possible solution for this problem is to add None value check before type conversion section in
_filter.py
This method worked for me (my fork).