From 1bea105a664785685f327ca69302f4a16a9cf8a0 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 31 Aug 2018 10:32:36 +0000 Subject: [PATCH] Sync docs from 2.0.x to gh-pages --- 2.0.x/multi/multi_contract-dsl.html | 29 +++++++++++++++++++++++ 2.0.x/single/spring-cloud-contract.html | 29 +++++++++++++++++++++++ 2.0.x/spring-cloud-contract.xml | 31 ++++++++++++++++++++++++- 3 files changed, 88 insertions(+), 1 deletion(-) diff --git a/2.0.x/multi/multi_contract-dsl.html b/2.0.x/multi/multi_contract-dsl.html index ce03249b27..911f3ea55e 100644 --- a/2.0.x/multi/multi_contract-dsl.html +++ b/2.0.x/multi/multi_contract-dsl.html @@ -956,6 +956,35 @@ matches the JSON Path. E.g. for json path $.foo - < responseBaz2: "Bla bla ${fromRequest().body('$.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/2.0.x/single/spring-cloud-contract.html b/2.0.x/single/spring-cloud-contract.html
index 5829751f0c..7b0304dbda 100644
--- a/2.0.x/single/spring-cloud-contract.html
+++ b/2.0.x/single/spring-cloud-contract.html
@@ -4346,6 +4346,35 @@ matches the JSON Path. E.g. for json path $.foo - <
 				responseBaz2: "Bla bla ${fromRequest().body('$.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/2.0.x/spring-cloud-contract.xml b/2.0.x/spring-cloud-contract.xml
index 56c1197768..062002d41d 100644
--- a/2.0.x/spring-cloud-contract.xml
+++ b/2.0.x/spring-cloud-contract.xml
@@ -4,7 +4,7 @@
 
 
 Spring Cloud Contract
-2018-08-31
+2018-08-30
 
 
 
@@ -7191,6 +7191,35 @@ matches the JSON Path. E.g. for json path $.foo - {{
 				responseBaz2: "Bla bla ${fromRequest().body('$.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())
+	}
 }