Question: Transformer and Delay in Static Mappings? #108

Closed
opened 2025-12-29 14:22:37 +01:00 by adam · 2 comments
Owner

Originally created by @rangerranger on GitHub (Jun 4, 2018).

Originally assigned to: @StefH on GitHub.

Hi - Do you know if it is possible to add the WithTransformer and WithDelay to already recorded static mappings? Wanted to check if this was already known before running some tests. Thank you.
Aroon

Originally created by @rangerranger on GitHub (Jun 4, 2018). Originally assigned to: @StefH on GitHub. Hi - Do you know if it is possible to add the WithTransformer and WithDelay to already recorded static mappings? Wanted to check if this was already known before running some tests. Thank you. Aroon
adam closed this issue 2025-12-29 14:22:37 +01:00
Author
Owner

@StefH commented on GitHub (Jun 4, 2018):

By static mappings, I think you mean the mappings defined in the .json file which are loaded at startup?

This is possible.

Transformation can be done like:

"UseTransformer": true,
      "StatusCode": 205,
      "BodyAsJson": { "result": "test - {{request.path}}" }

And delay is like:

"Response": {
            "StatusCode": 200,
            "Delay": 100
        }

See also this example https://github.com/WireMock-Net/WireMock.Net/wiki/Admin-API-Reference#post-__adminmappings

@StefH commented on GitHub (Jun 4, 2018): By static mappings, I think you mean the mappings defined in the .json file which are loaded at startup? This is possible. **Transformation** can be done like: ``` json "UseTransformer": true, "StatusCode": 205, "BodyAsJson": { "result": "test - {{request.path}}" } ``` And **delay** is like: ``` json "Response": { "StatusCode": 200, "Delay": 100 } ``` See also this example https://github.com/WireMock-Net/WireMock.Net/wiki/Admin-API-Reference#post-__adminmappings
Author
Owner

@rangerranger commented on GitHub (Jun 4, 2018):

Thank you Stef.

Aroon

@rangerranger commented on GitHub (Jun 4, 2018): Thank you Stef. Aroon
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#108