Sha256: fe1d753663752668adc717fed033230c06549510bd61ca4c0a01b4979849169f

Contents?: true

Size: 1.35 KB

Versions: 3

Compression:

Stored size: 1.35 KB

Contents

{
  "sampleData":
    ["{\"root\":{\"parent1\":{\"child1\":\"5\", \"child2\":\"parent1 word\"},\"parent2\":{\"uniq\":\"val\",\"child2\":\"word2\"}}}" ],
  "methods": [
    {
      "desc": "Get response object",
      "method": "@exchange.response",
      "result": "# RestClient::Response"
    },
    {
      "desc": "Value from unique element",
      "method": "@exchange['uniq']",
      "result": "'val' # String",
      "highlight": "\"uniq\""
    },
    {
      "desc": "Value via JSONPath",
      "method": "@exchange['$..parent1.child2']",
      "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_from_path('$..child2')",
      "result": "['parent1 word', 'word2'] # Array",
      "highlight": "\"child2\""
    },
    {
      "desc": "Convert response into hash",
      "method": "@exchange.to_hash",
      "result": "{\"root\"=>{\"parent1\"=>{\"child1\"=>\"5\", \"child2\"=>\"parent1 word\"}, \"parent2\"=>{\"uniq\"=>\"val\", \"child2\"=>\"word2\"}}} # Hash accessable through symbol or string"
    }
  ]
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
soaspec-0.2.20 demo/json_extract.json
soaspec-0.2.19 demo/json_extract.json
soaspec-0.2.18 demo/json_extract.json