Skip to content

204 response prevent any switchResponses to be executed #81

@gabric098

Description

@gabric098

Take this simple endpoint config example:

"cards/updatePin": {
      "verbs": ["post"],
      "switch": ["notfound", "unauthorised"],
      "responses":{
        "post": {
            "httpStatus": 204
        }
      },
      "switchResponses": {
        "notfoundtrue": {"httpStatus": 404, "mockFile": "notfound.json"},
        "unauthorisedtrue": {"httpStatus": 403, "mockFile": "unauthorised.json"}
      }
    }

make a post request to cards/updatePin?notfound=true or cards/updatePin?unauthorised=true

EXPECTED result:

a 404 or 403 response is returned with payload defined in notfound.json or unauthorised.json

ACTUAL result:
204 code is always returned

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions