From 2087eba4b36df336f4bfd0e88ff94ac87b33972e Mon Sep 17 00:00:00 2001 From: Shreya Agarwal Date: Sat, 9 Dec 2023 02:45:03 +0530 Subject: [PATCH] Add new fake data helper to response-templating.md (#211) * Add new fake data helper to response-templating.md Helper added as part of https://github.com/wiremock/wiremock/pull/2438 * Add extension details * Update response-templating.md * Update response-templating.md add github repo * Update response-templating.md --------- Co-authored-by: Oleg Nenashev --- _docs/response-templating.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/_docs/response-templating.md b/_docs/response-templating.md index cf3635b4..a724cda7 100644 --- a/_docs/response-templating.md +++ b/_docs/response-templating.md @@ -631,6 +631,18 @@ Likewise decimals can be produced with or without bounds: {% endraw %} +## Fake data helpers + +This helper produces random fake data of the desired types available in the [Data Faker library](https://github.com/datafaker-net/datafaker). Due to the size of this library, this helper has been provided via [`RandomExtension`](https://github.com/wiremock/wiremock-faker-extension). +{% raw %} + +```handlebars +{{random 'Name.first_name'}} +{{random 'Address.postcode_by_state.AL' }} +``` + +{% endraw %} + ## Math helper The `math` (or maths, depending where you are) helper performs common arithmetic operations. It can accept integers, decimals @@ -926,3 +938,7 @@ public WireMockRule wm = new WireMockRule(options() ) ); ``` + +The regular expressions are matched in a case-insensitive manner. +If no permitted system key patterns are set, a single default of `wiremock.*` will be used. +