79274983

Date: 2024-12-12 11:51:32
Score: 1.5
Natty:
Report link

As of v3.0 Wiremock supports path templating with urlPathTemplate

https://wiremock.org/docs/request-matching/#path-templates

{
      "request": {
        "urlPathTemplate": "/contacts/{contactId}/addresses/{addressId}"
        "method" : "GET",
    
      },
      "response" : {
        "status" : 200
      }
    }

You can then reference it directly in the response template. Example: {{request.path.contactId}}

https://wiremock.org/docs/response-templating/#the-request-model

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Amran Ahmad