From 45e8c61eb2ba584aa3d86fa0296e34655836e77e Mon Sep 17 00:00:00 2001 From: leeturner Date: Thu, 29 Feb 2024 16:47:59 +0000 Subject: [PATCH 1/3] Add the mapping of the extensions folder in the docker volumes --- _docs/standalone/docker.md | 1 + 1 file changed, 1 insertion(+) diff --git a/_docs/standalone/docker.md b/_docs/standalone/docker.md index 2ebc00b4..70eff8d5 100644 --- a/_docs/standalone/docker.md +++ b/_docs/standalone/docker.md @@ -123,6 +123,7 @@ services: image: "wiremock/wiremock:latest" container_name: my_wiremock volumes: + - ./extensions:/var/wiremock/extensions - ./__files:/home/wiremock/__files - ./mappings:/home/wiremock/mappings entrypoint: ["/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose"] From 4fabb2e4c63f43ed736a392b504ea4b7f3af1c73 Mon Sep 17 00:00:00 2001 From: leeturner Date: Thu, 29 Feb 2024 16:48:50 +0000 Subject: [PATCH 2/3] Give an example of how to disable response templating on a per stub basis. --- _docs/response-templating.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/_docs/response-templating.md b/_docs/response-templating.md index a724cda7..79a765d8 100644 --- a/_docs/response-templating.md +++ b/_docs/response-templating.md @@ -30,6 +30,24 @@ WireMockServer wm = See [the command line docs](../standalone/java-jar/#command-line-options) for the standalone equivalents of these parameters. +Response templating can also be disabled on a per-stub basis by adding the `disableBodyFileTemplating` parameter to the +`transformerParameters` object in the stub response definition. + +```json +{ + "request": { + "method": "GET", + "urlPath": "/test" + }, + "response": { + "status": 200, + "body": "Body content", + "transformerParameters": { + "disableBodyFileTemplating": true + } + } +} +``` ## Customising and extending the template engine From 4dd88ba4616ca46e61aeb7b9097d2652447351a8 Mon Sep 17 00:00:00 2001 From: leeturner Date: Mon, 4 Mar 2024 09:39:40 +0000 Subject: [PATCH 3/3] Clarify when response templating can be disabled on a per stub basis --- _docs/response-templating.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_docs/response-templating.md b/_docs/response-templating.md index 79a765d8..b943adea 100644 --- a/_docs/response-templating.md +++ b/_docs/response-templating.md @@ -30,8 +30,8 @@ WireMockServer wm = See [the command line docs](../standalone/java-jar/#command-line-options) for the standalone equivalents of these parameters. -Response templating can also be disabled on a per-stub basis by adding the `disableBodyFileTemplating` parameter to the -`transformerParameters` object in the stub response definition. +Response templating can also be disabled on a per-stub basis when using the `bodyFileName` element by adding the +`disableBodyFileTemplating` parameter to the `transformerParameters` object in the stub response definition. ```json { @@ -41,7 +41,7 @@ Response templating can also be disabled on a per-stub basis by adding the `disa }, "response": { "status": 200, - "body": "Body content", + "bodyFileName": "response.json", "transformerParameters": { "disableBodyFileTemplating": true }