Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new fake data helper to response-templating.md #211

Merged
merged 6 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.