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

Conditional statements #17

Open
joro550 opened this issue Sep 18, 2020 · 1 comment
Open

Conditional statements #17

joro550 opened this issue Sep 18, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@joro550
Copy link
Owner

joro550 commented Sep 18, 2020

{
    "description": "A GET request to retrieve a thing",
    "request": {
        "method": "get",
        "path": "/things/{id:int}"
    },
    "response": {
        "where": [
            {
                "condition": "id == 10",
                "response": {}
            },
            {
                "condition": "id == 11",
                "response": {}
            }
        ]
    }
}

Maybe this makes sense?

@joro550 joro550 added enhancement New feature or request help wanted Extra attention is needed labels Sep 18, 2020
@joro550 joro550 added this to the Future milestone Sep 18, 2020
@joro550
Copy link
Owner Author

joro550 commented Sep 18, 2020

For post requests it could be:

"condition" : "$.prop.prop == 10"

Could add array evaluation:

"condition" : "$.prop.prop in [10, 12, 13]"

ofc you would need some && || operators:

"condition" : "$.prop.prop == 10 and $.prop.prop == 11 or ..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant