Open lzecca78 opened 11 months ago
Hi,
Unfortunately, at the moment, we and gjson only check the existence of keys therefore you can use --expect-body-regex
instead:
$ wait4x http https://ifconfig.co/json --expect-body-regex '"version": "1234"'
The "condition" only works in the array based on the gjson documentation https://github.com/tidwall/gjson
@atkrad suggested to use https://github.com/antonmedv/expr to handle complex expressions. Maybe in the future, we'll support it. @lzecca78 you can send a PR if you would like to contribute.
If you have any ideas, we would be happy to hear them to fix the issue fundamentally.
Hi, i am using wait4x in the pipeline using the HTTP provider in order to compare a specific body JSON key with a specific value. AFAIK, also looking at the gjson doc, this seems not possible. For example a body with
cannot be done afaik with --expect-body-json with something like:
wait4x http https://ifconfig.co/json --expect-body-json "version==1234" or something similar.