Skip to content

Commit

Permalink
Add new fake data helper to response-templating.md (#211)
Browse files Browse the repository at this point in the history
* Add new fake data helper to response-templating.md

Helper added as part of wiremock/wiremock#2438

* Add extension details

* Update response-templating.md

* Update response-templating.md

add github repo

* Update response-templating.md

---------

Co-authored-by: Oleg Nenashev <[email protected]>
  • Loading branch information
Shreya-7 and oleg-nenashev authored Dec 8, 2023
1 parent 196bfb7 commit 2087eba
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions _docs/response-templating.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

0 comments on commit 2087eba

Please sign in to comment.