title: How to write a custom feeder for gatling json?
body: <p>I have a <code>jsonurl</code> which I want to read and it looks like this:</p>
  
  <pre><code>&gt; {
  &gt;     "elements": [
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 0,
  &gt;           "y": 0,
  &gt;           "width": 186,
  &gt;           "height": 10.526316
  &gt;         },
  &gt;         "type": "Header"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 0,
  &gt;           "y": 0,
  &gt;           "width": 0,
  &gt;           "height": 0
  &gt;         },
  &gt;         "type": "Regular"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 0,
  &gt;           "y": 14.035088,
  &gt;           "width": 43.333332,
  &gt;           "height": 3.508772
  &gt;         },
  &gt;         "type": "Regular"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 95.08772,
  &gt;           "y": 14.035088,
  &gt;           "width": 90.87719,
  &gt;           "height": 45.614037
  &gt;         },
  &gt;         "type": "Image"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 95.08772,
  &gt;           "y": 63.157894,
  &gt;           "width": 90.87719,
  &gt;           "height": 3.508772
  &gt;         },
  &gt;         "type": "Regular"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 95.08772,
  &gt;           "y": 63.157894,
  &gt;           "width": 90.87719,
  &gt;           "height": 3.508772
  &gt;         },
  &gt;         "type": "Regular"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 47.54386,
  &gt;           "y": 42.105263,
  &gt;           "width": 43.333332,
  &gt;           "height": 5.9649124
  &gt;         },
  &gt;         "type": "Regular"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 0,
  &gt;           "y": 0,
  &gt;           "width": 43.333332,
  &gt;           "height": 98.24561
  &gt;         },
  &gt;         "type": "Regular"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 47.54386,
  &gt;           "y": 0,
  &gt;           "width": 43.333332,
  &gt;           "height": 98.24561
  &gt;         },
  &gt;         "type": "Regular"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 95.08772,
  &gt;           "y": 0,
  &gt;           "width": 43.333332,
  &gt;           "height": 98.24561
  &gt;         },
  &gt;         "type": "Regular"
  &gt;       },
  &gt;       {
  &gt;         "box": {
  &gt;           "x": 142.63158,
  &gt;           "y": 0,
  &gt;           "width": 43.333332,
  &gt;           "height": 98.24561
  &gt;         },
  &gt;         "type": "Regular"
  &gt;       }
  &gt;     ],
  &gt;     "points": [
  &gt;       {
  &gt;         "x": 190,
  &gt;         "y": 22.192982
  &gt;       },
  &gt;       {
  &gt;         "x": 376,
  &gt;         "y": 22.192982
  &gt;       },
  &gt;       {
  &gt;         "x": 376,
  &gt;         "y": 120.4386
  &gt;       },
  &gt;       {
  &gt;         "x": 190,
  &gt;         "y": 120.4386
  &gt;       }
  &gt;     ],
  &gt;     "state": "UNUSED",
  &gt;     "contentPath": "/content/ffx/print-authoring/en/newsholes/FNZ/DPT/2016/05/30/test_pages/q001/newshole-63019301",
  &gt;     "assetId": null   },
  </code></pre>
  
  <p>I then want to read the <code>"state"</code> and <code>"contentPath"</code> and map them.
  currently I am using a static source like:</p>
  
  <blockquote>
    <p>val nhfeeder = jsonFile("shapes-data.json")</p>
  </blockquote>
  
  <p>using as,</p>
  
  <blockquote>
    <p>.feed(nhfeeder)</p>
  </blockquote>
  
  <p>which is a static source so I want a custom feeder which can read directly from the <code>jsonurl</code> and do the needful.</p>