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

Add "AND" relations in route responses rules #201

Closed
neil-liao-dragon opened this issue Nov 6, 2019 · 11 comments · Fixed by #273
Closed

Add "AND" relations in route responses rules #201

neil-liao-dragon opened this issue Nov 6, 2019 · 11 comments · Fixed by #273
Assignees
Milestone

Comments

@neil-liao-dragon
Copy link

Currently I saw user can add multiple rules for a response. But these rule check condition is "OR", for example if I have 2 rules for this response, then if rule1=true or rule2=ture, then this response will match and returned. Whether I want the AND relation, which means only when rule1=true AND rule2=true, this response will return. Do we have this feature? if not, when?

@255kb
Copy link
Member

255kb commented Nov 7, 2019

Not yet and it's currently not planned. Rules are for now very simple: a response is served as soon as a rule is matched. On a "first come first serve" basis, I would say.

@255kb 255kb changed the title Whether there is rule for "AND" relation Add "AND" relations in route responses rules Nov 7, 2019
@WSTurner
Copy link

WSTurner commented Mar 4, 2020

I would love this enhancement.

@jamescch
Copy link

Same for me. It would be much greater with this feature.

@ninjaneer164
Copy link
Contributor

hi @255kb , one of our teams needed this feature recently, so i've made some changes. i would love to be able to create a PR for it. let me know!

@255kb
Copy link
Member

255kb commented Mar 19, 2020

@ninjaneer164 This would be great. I will assign the issue to you. Feel free to open the PR as early as possible so we can start discussing the implementation if needed. And remember, DRY, KISS, etc 😸

@jotitajc
Copy link

It would be good if this improvement closes, which makes the tool more powerful.

@krishnaSpotnana
Copy link

This is an important feature.It would be great if its fixed soon.

@kriefsacha
Copy link

This is a very big issue.. I actually don't understand when you will need a OR condition on URL parameters ..

Need it as soon as possible please

@255kb 255kb added this to the next milestone Jul 28, 2020
@255kb 255kb self-assigned this Jul 29, 2020
255kb pushed a commit that referenced this issue Jul 31, 2020
- add btn-xs / xxs styles
- change rules operator AND/OR design to be a floating switch on the left side of the rules (hidden when having only one rule)
- move the rules operator in a property directly in the route response
- add migration to create rulesOperator, and a migration test
- add rules operator tests suite
- Closes #321 by transforming rule value to a string
Closes #201
@255kb 255kb closed this as completed in 5beb1b0 Jul 31, 2020
@JanithaR
Copy link

Here in the documentation, it is mentioned that there's a button to the left of the rules but I do not see it on my installation. I'm using Mockoon v1.9.0 on Mac.

@255kb
Copy link
Member

255kb commented Sep 17, 2020

@JanithaR It has been added 2 days ago in v1.10.0! You should do an update :)

@JanithaR
Copy link

@JanithaR It has been added 2 days ago in v1.10.0! You should do an update :)

Excellent! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

9 participants