Benoît Bargès
03/19/2025, 11:00 AMwiremock:
image: ${PUBLIC_REGISTRY_PROXY:-}wiremock/wiremock:latest
command: ["--local-response-templating", "--global-response-templating"]
Then my mapping includes
"response": {
"status": 200,
"bodyFileName": "rooms/apitude/simpsons/availabilities.json",
"additionalProxyRequestHeaders": {
"X-Wiremock": "stub"
},
"transformers": ["response-template"]
}
But finally when I log the response in my workflow, the templating does not apply
"checkIn": "{{now offset='+1 days' format='yyyy-MM-dd'}}",
Does someone know what's wrong please ?Lee Turner
03/19/2025, 11:18 AMlocal-response-templating
and global-response-templating
. Local is the default in the latest version so you shouldn't need either from what I can tellBenoît Bargès
03/19/2025, 11:20 AMentrypoint: ['/docker-entrypoint.sh', '--global-response-templating', '--verbose']
but this is still not working 😕Lee Turner
03/19/2025, 11:27 AMBenoît Bargès
03/19/2025, 12:08 PMLee Turner
03/19/2025, 12:22 PMversion: "3"
services:
wiremock:
image: "wiremock/wiremock:nightly"
ports:
- "8080:8080"
container_name: wiremock
volumes:
- ./wiremock/__files:/home/wiremock/__files
- ./wiremock/mappings:/home/wiremock/mappings
- ./wiremock/extensions:/var/wiremock/extensions
entrypoint: [ "/docker-entrypoint.sh", "--verbose" ]
{
"request": {
"method": "GET",
"url": "/foo"
},
"response": {
"status": 200,
"bodyFileName": "rooms/apitude/simpsons/availabilities.json",
"additionalProxyRequestHeaders": {
"X-Wiremock": "stub"
},
"transformers": [
"response-template"
]
}
}
The availabilities,json
file contains the following:
{
"checkIn": "{{now offset='+1 days' format='yyyy-MM-dd'}}"
}
When I send a request, I get the following:
{
"checkIn": "2025-03-20"
}
Just out of interest, when you start your container, what version does it show?Benoît Bargès
03/19/2025, 12:32 PMversion: 3.10.0
Lee Turner
03/19/2025, 1:28 PMLee Turner
03/19/2025, 1:31 PMBenoît Bargès
03/19/2025, 1:47 PM<https://wiremock.worldia.loc>
in docker
wiremock:
image: 'wiremock/wiremock:nightly'
command: '--global-response-templating --verbose'