0

I was trying to pass path parameter using Mountebank.

Below is working, but there path is static no any parameters.

"predicates": [
            {
              "equals": {
                "method": "GET",
                "path": "/accounts",
                "query": {
                  "permissionId": "xxx"
                }
              }
            }
          ],
          "responses": [
            {
              .....            }
          ]

In case if I need to do GET /accounts/[account-no] where account-no is a parameter

Shabar
  • 2,617
  • 11
  • 57
  • 98

1 Answers1

0

Below regex worked, Please note use matches in case of regex instead of equal

"predicates": [
            {
              "matches": {
                "method": "GET",
                "path": "/accounts/\\d+",
                "query": {
                  "permissionId": "xxx"
                }
              }
            }
          ],
          "responses": [
            {
              .....            }
          ]
Shabar
  • 2,617
  • 11
  • 57
  • 98