hurl
hurl copied to clipboard
Merge `includes` and `contains` to `contains`
includes
tests if a value is included in a collection, while contains
test if a string/byte array is contained in a string/byte array.
We could merge the two predicates an only use contains
to simplify the grammar (see https://hurl.dev/docs/asserting-response.html#predicates)
While I do like this idea, one reason to NOT to do it (just brainstorming) might be to make contains
behave as an inner string/byte array search regardless of type and keep includes
as equality in an array/object. For example, you could have this array:
[ "abc", "foobar", "def" ]
...or this object:
{ "abc": true, "foobar": "bar", "def": 123 }
...and these asserts:
jsonpath "$" includes "foo" # false
jsonpath "$" contains "foo" # true
However, if you don't like that idea then I would agree to merge them.