demo/extract.json in soaspec-0.2.16 vs demo/extract.json in soaspec-0.2.17
- old
+ new
@@ -1,36 +1,40 @@
{
"sampleData":
- {"root":
- {"parent1":
- {"child1":5,"child2":"parent1 word"},
- "parent2":
- {"uniq":"val","child2":"word2"}}
- },
+ ["{\"root\":{\"parent1\":{\"child1\":\"5\", \"child2\":\"parent1 word\"},\"parent2\":{\"uniq\":\"val\",\"child2\":\"word2\"}}}" ],
"methods": [
{
"desc": "Get response object",
"method": "@exchange.response",
- "result": "RestClient::Response or Savon::Response"
+ "result": "# RestClient::Response or Savon::Response object"
},
{
- "desc": "Unique element from body",
+ "desc": "Value from unique element",
"method": "@exchange['uniq']",
- "result": "'val'"
+ "result": "'val' # String",
+ "highlight": "\"uniq\""
},
{
- "desc": "Element from body via JSONPath",
+ "desc": "Value via JSONPath",
"method": "@exchange['$..parent1.child2']",
- "result": "'parent1 word'"
+ "result": "'parent1 word' # String",
+ "highlight": " \"child2\""
},
{
+ "desc": "Value via first matching JSONPath",
+ "method": "@exchange['$..parent1.uniq,$..parent2.uniq']",
+ "result": "'val' # String. (First JSONPath didn't find anything so second was used)",
+ "highlight": "\"uniq\""
+ },
+ {
"desc": "List of values matching JSONPath",
"method": "@exchange.values_at_path('$..child2')",
- "result": "['parent1 word', 'word2']"
+ "result": "['parent1 word', 'word2'] # Array",
+ "highlight": "\"child2\""
},
{
"desc": "Convert response into hash",
"method": "@exchange.to_hash",
- "result": "{:root=>{:parent1=>{:child1=>5, :child2=>\"word\"}, :parent2=>{:uniq=>\"val\", :child2=>\"word2\"}}}"
+ "result": "{:root=>{:parent1=>{:child1=>5, :child2=>\"parent1 word\"}, :parent2=>{:uniq=>\"val\", :child2=>\"word2\"}}} # Hash"
}
]
}
\ No newline at end of file