diff --git a/multi/multi_contract-dsl.html b/multi/multi_contract-dsl.html
index b8730c82c3..15b9c76cad 100644
--- a/multi/multi_contract-dsl.html
+++ b/multi/multi_contract-dsl.html
@@ -966,6 +966,35 @@ matches the JSON Path. E.g. for json path $.foo - <
rawResponseBaz2: "Bla bla ${fromRequest().rawBody('$.foo')} bla bla"
)
}
+}
+Contract contractDsl = Contract.make {
+ request {
+ method 'GET'
+ url('/api/v1/xxxx') {
+ queryParameters {
+ parameter("foo", "bar")
+ parameter("foo", "bar2")
+ }
+ }
+ headers {
+ header(authorization(), "secret")
+ header(authorization(), "secret2")
+ }
+ body(foo: "bar", baz: 5)
+ }
+ response {
+ status OK()
+ headers {
+ contentType(applicationJson())
+ }
+ body('''
+ {
+ "responseFoo": "{{{ jsonPath request.body '$.foo' }}}",
+ "responseBaz": {{{ jsonPath request.body '$.baz' }}},
+ "responseBaz2": "Bla bla {{{ jsonPath request.body '$.foo' }}} bla bla"
+ }
+ '''.toString())
+ }
}
YAML.
request:
diff --git a/single/spring-cloud-contract.html b/single/spring-cloud-contract.html
index e89f4047d0..61e9ce3cd2 100644
--- a/single/spring-cloud-contract.html
+++ b/single/spring-cloud-contract.html
@@ -4305,6 +4305,35 @@ matches the JSON Path. E.g. for json path $.foo - <
rawResponseBaz2: "Bla bla ${fromRequest().rawBody('$.foo')} bla bla"
)
}
+}
+Contract contractDsl = Contract.make {
+ request {
+ method 'GET'
+ url('/api/v1/xxxx') {
+ queryParameters {
+ parameter("foo", "bar")
+ parameter("foo", "bar2")
+ }
+ }
+ headers {
+ header(authorization(), "secret")
+ header(authorization(), "secret2")
+ }
+ body(foo: "bar", baz: 5)
+ }
+ response {
+ status OK()
+ headers {
+ contentType(applicationJson())
+ }
+ body('''
+ {
+ "responseFoo": "{{{ jsonPath request.body '$.foo' }}}",
+ "responseBaz": {{{ jsonPath request.body '$.baz' }}},
+ "responseBaz2": "Bla bla {{{ jsonPath request.body '$.foo' }}} bla bla"
+ }
+ '''.toString())
+ }
}
YAML.
request: diff --git a/spring-cloud-contract.xml b/spring-cloud-contract.xml index c0a0109511..ef9a1b8cf2 100644 --- a/spring-cloud-contract.xml +++ b/spring-cloud-contract.xml @@ -7126,6 +7126,35 @@ matches the JSON Path. E.g. for json path$.foo -{{ rawResponseBaz2: "Bla bla ${fromRequest().rawBody('$.foo')} bla bla" ) } +} +Contract contractDsl = Contract.make { + request { + method 'GET' + url('/api/v1/xxxx') { + queryParameters { + parameter("foo", "bar") + parameter("foo", "bar2") + } + } + headers { + header(authorization(), "secret") + header(authorization(), "secret2") + } + body(foo: "bar", baz: 5) + } + response { + status OK() + headers { + contentType(applicationJson()) + } + body(''' + { + "responseFoo": "{{{ jsonPath request.body '$.foo' }}}", + "responseBaz": {{{ jsonPath request.body '$.baz' }}}, + "responseBaz2": "Bla bla {{{ jsonPath request.body '$.foo' }}} bla bla" + } + '''.toString()) + } }