flipper icon indicating copy to clipboard operation
flipper copied to clipboard

Discussion: Network Plugin - Add checkbox for enabling a "starts with" match on mocks

Open bizzguy opened this issue 3 years ago • 4 comments

Currently a mock route is identified with a key of "http method" and "url".

I'm suggesting that an additional matching method be added.

The API I'm currently using as some extraneous qualifiers at the end that I would like to ignore.

For example. The API might look like this:

https://www.example.com/query/product?id=123&page=2&other=7 https://www.example.com/query/product?id=123&page=3&other=9

I would really like the mocks to ignore the parameters at the end so that I would define the mock as

https://www.example.com/query/product?id=123

And then enable a "startsWith" checkbox. Mocking would then only match on the beginning of the url. So any api staring with the string would match.

Another idea would be to define the url with a regular expression (as an option).

Would this feature be interesting/useful to anyone?

bizzguy avatar Apr 02 '21 16:04 bizzguy