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