wiremock
wiremock copied to clipboard
Unwrap ListOrSingle values in helpers
Currently helpers e.g. eq and jsonPath don't work properly with ListOrSingle values unless you explicitly use the indexed form.
This is pretty confusing so helpers should check for this condition and unwrap singular values from ListOrSingle so that the index becomes unnecessary.
@tomakehurst Is this issue still active?
I notice there is a previous commit https://github.com/wiremock/wiremock/commit/618d82517f3180340b7b54ce051dbfd3004addd3 in JsonPath. Does anything require to improve so far?
I haven't yet found a way to do this that doesn't cause regressions. I think it's safe to assume it's not going to happen for quite a while, if at all.
You always have the option of using the indexed form of the attributes, or if you've got multiple values you can use the new contains helper e.g. {{#contains request.query.myParam 'value'}}