Skip to content

Commit

Permalink
Merge branch 'main' into live-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
tomakehurst committed Feb 16, 2024
2 parents baaa2d5 + 0ea3a52 commit 91dffa5
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ compress_html:
ignore:
envs: development

wiremock_version: 3.3.1
wiremock_version: 3.4.0
wiremock_baseline: 3.x
pageEditPrefix: https://github.com/wiremock/wiremock.org/edit/main/

Expand Down
33 changes: 32 additions & 1 deletion _docs/request-matching.md
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,38 @@ stubFor(
.willReturn(ok()));
```

JSON:
JSON (supported in 3.4+):

```json
{
"request" : {
"urlPath" : "/schema-match",
"method" : "POST",
"bodyPatterns" : [ {
"matchesJsonSchema" : {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
},
"schemaVersion" : "V202012"
} ]
},
"response" : {
"status" : 200
}
}
```

JSON with string literal:

```json
{
Expand Down
17 changes: 17 additions & 0 deletions _docs/stubbing.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,20 @@ This can be changed by setting `duplicatePolicy` in the JSON to `IGNORE` or call

If you want to ensure that the only stubs loaded after the import has completed are the ones it contains, you can set
`"deleteAllNotInImport": true` in the JSON or call `deleteAllExistingStubsNotInImport()` on the Java builder.

### Disabling Gzip at the ResponseDefinitionBuilder

If you want to user Gzip disabled response option at the ResponseDefinitionBuilder level.
You can use `.withGzipDisabled(true)`

```java

wireMockServer.stubFor(get(urlEqualTo("/todo/items"))
.willReturn(aResponse()
.withStatus(200)
.withGzipDisabled(true)
.withBody(
"Here is some kind of response body"
+ "Here is some kind of response body"
+ "Here is some kind of response body")));
```

0 comments on commit 91dffa5

Please sign in to comment.