Skip to content

Commit

Permalink
Fix rendering of Macros
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev committed Nov 28, 2023
1 parent 307a45e commit 9fcfe90
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
15 changes: 10 additions & 5 deletions _docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,22 @@ The ruleset is built and applied as follows:

## Filename template

WireMock can set up specific filename template format based on stub information.
The main rule for set up specify stub metadata information in handlebar format.
For instance for endpoint `PUT /hosts/{id}` and format `{{{method}}}-{{{request.url}}}.json`
will be generated: `put-hosts-id.json` filename. Default template: `{{{method}}}-{{{path}}}-{{{id}}}.json`.
WireMock can set up specific filename template format based on stub information.
The main rule for set up specify stub metadata information in handlebar format.
For instance for endpoint `PUT /hosts/{id}` and format
{% raw %} `{{{method}}}-{{{request.url}}}.json`{% endraw %}
will be generated: `put-hosts-id.json` filename.
Default template: {% raw %} `{{{method}}}-{{{path}}}-{{{id}}}.json` {% endraw %}.

{% raw %}

```java
.filenameTemplate("{{{request.url}}}-{{{request.url}}}.json")
```

Note: starting from [3.0.0-beta-8](https://github.com/wiremock/wiremock/releases/tag/3.0.0-beta-8)
{% endraw %}

Note: starting from [3.0.0-beta-8](https://github.com/wiremock/wiremock/releases/tag/3.0.0-beta-8)

## Listening for raw traffic

Expand Down
9 changes: 6 additions & 3 deletions _docs/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Add the extension JAR dependency to your project:
Gradle:

```gradle
implementation 'org.wiremock:wiremock-grpc-extension:{{ site.grpc_extension_version }}'
implementation 'org.wiremock:wiremock-grpc-extension:{{ versions.grpc_extension_version }}'
```

Maven:
Expand All @@ -38,7 +38,7 @@ Maven:
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-grpc-extension</artifactId>
<version>{{ site.grpc_extension_version }}</version>
<version>{{ versions.grpc_extension_version }}</version>
</dependency>
```

Expand Down Expand Up @@ -78,9 +78,10 @@ mockGreetingService.stubFor(
.willReturn(json("{ "greeting": "Hi Tom from JSON" }")));
```


Or with a templated response:

{% raw %}

```java
mockGreetingService.stubFor(
method("greeting")
Expand All @@ -90,6 +91,8 @@ mockGreetingService.stubFor(
"{ \"greeting\": \"Hello {{jsonPath request.body '$.name'}}\" }")));
```

{% endraw %}

### Stubbing via Java message objects

Matching and stubbing in the Java DSL can also be specified using the Java classes generated by `protoc`:
Expand Down
6 changes: 3 additions & 3 deletions _docs/standalone/java-jar.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ The last of these will cause chunked encoding to be used only when a stub define

`--logged-response-body-size-limit`: Set a limit in bytes beyond which response bodies in the log will be truncated. When enabled this helps avoid out of memory errors when serving large response bodies.

`--allow-proxy-targets`: Limit the permitted targets for proxying to and recording from the supplied addressess. This parameter takes a comma-separated list of single IP addresses, IP address ranges and hostname wildcards. See [this article](./../configuration.md#preventing-proxying-to-and-recording-from-specific-target-addresses) for details.
`--allow-proxy-targets`: Limit the permitted targets for proxying to and recording from the supplied addresses. This parameter takes a comma-separated list of single IP addresses, IP address ranges and hostname wildcards. See [this article](./../configuration.md#preventing-proxying-to-and-recording-from-specific-target-addresses) for details.

`--deny-proxy-targets`: Prevent proxying to and recording from the supplied addressess. This parameter takes a comma-separated list of single IP addresses, IP address ranges and hostname wildcards. Note: if both `--allow-proxy-targets` and this parameter are set, the allow list will be evaluated first. See [this article](./../configuration.md#preventing-proxying-to-and-recording-from-specific-target-addresses) for details.
`--deny-proxy-targets`: Prevent proxying to and recording from the supplied addresses. This parameter takes a comma-separated list of single IP addresses, IP address ranges and hostname wildcards. Note: if both `--allow-proxy-targets` and this parameter are set, the allow list will be evaluated first. See [this article](./../configuration.md#preventing-proxying-to-and-recording-from-specific-target-addresses) for details.

`--proxy-timeout`: Set the timeout for requests to the proxy in milliseconds

`--proxy-pass-through`: Flag used in browser-caching in order to enable or disable pass through unmatched requests to the target indicated by the original requests. By default, this flag is enabled and let the requests pass through.

`--filename-template`: Set filename template in handlebar format. For endpoint: `GET /pets/{id}` using the format: `{{{method}}}-{{{url}}}.json` output will be `get-pets-id.json`. Default format: `{{{method}}}-{{{path}}}-{{{id}}}.json` hence by default template filename will be: `get-pets-id-1.json`.
`--filename-template`: Set filename template in handlebar format. For endpoint: `GET /pets/{id}` using the format: {% raw %} `{{{method}}}-{{{url}}}.json` {% endraw %} output will be `get-pets-id.json`. Default format: {% raw %} `{{{method}}}-{{{path}}}-{{{id}}}.json` {% endraw %} hence by default template filename will be: `get-pets-id-1.json`.
Note: introduced in [3.0.0-beta-8](https://github.com/wiremock/wiremock/releases/tag/3.0.0-beta-8).

`--help`: Show command line help
Expand Down

0 comments on commit 9fcfe90

Please sign in to comment.