Closed Powerrr closed 1 year ago
Hello, the question of an "or" operator came up when we were designing the way mocks work. And what you present as a workaround was the simplest solution we could find to keep mocks clear and understandable. We should definitely make this clearer in the documentation.
Duplicating may seem a little overkill but on the other hand it ensures exaustive signatures on expected calls.
Sometimes we don't care if a particular parameter is sent in the query string or in the
application/x-www-form-urlencoded
body, because the application that we mock can consume that parameter either way. For such a case it would be nice if there was a way to setup a mock using some combined condition, smth. likeso that it would match both
POST /foobar?qwe=asd
andPOST -H 'Content-type: application/x-www-form-urlencoded' /foobar --data 'qwe=asd'
. Basically, it would look for theqwe
param both in the query and in the body.(Currently my workaround is adding 2 mocks: one matches the query, another matches the body.)
So is it possible to add a feature like this?