Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bizzguy opened this issue Apr 2, 2021 · 4 comments
Labels
plugin-network PR welcome We're looking for community members to implement this!

Comments

@bizzguy
Copy link
Contributor

bizzguy commented Apr 2, 2021

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 bizzguy changed the title Discussion: Network Plugin - Add checkbox for enable a "starts with" match on mocks Discussion: Network Plugin - Add checkbox for enabling a "starts with" match on mocks Apr 2, 2021
@mweststrate mweststrate added plugin-network PR welcome We're looking for community members to implement this! labels Sep 14, 2021
@stale
Copy link

stale bot commented Jan 8, 2022

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale label Jan 8, 2022
@BelyakovLeonid
Copy link

@mweststrate It would be really nice if we have an option to use regular expressions to specify URLs for mocking

@stale stale bot removed the Stale label Jul 14, 2022
@alessandrogaboardi
Copy link

Any news on this issue? Some wildcard character or similar? Regex? Other workarounds around the issue? At the moment I have to mock an API with current timestamp in query parameter so I can't mock the call at all unless I can ignore the value of the timestamp

@SowmiaS
Copy link

SowmiaS commented Jul 22, 2024

I have the same issue with Flipper version 0.254.0. I want to mock the URL regardless of its query parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin-network PR welcome We're looking for community members to implement this!
Projects
None yet
Development

No branches or pull requests

5 participants