Rest API Data Source - Creating Associations for nested JSON

Let’s say that I’m using the Rest API plugin to connect to a data source that returns something like this for a GET request:

{
  "data": {
    "id": 123456,
    "fields": [
      {
        "fieldId": "RdnQzMEJyYBbXQNi",
        "name": "mastersDegree",
        "type": "checkbox"
      },
      {
        "fieldId": "myFfuWoBwZPDQHjs",
        "name": "experience",
        "type": "radio",
        "required": true,
        "default_value": "3000Hours",
        "preferences": {},
        "options": [
          {
            "value": "twoYears",
            "uuid": "e180394f-8a0a-4b49-b9c3-44ce3e7aa698"
          },
          {
            "value": "3000Hours",
            "uuid": "3e83cf30-662a-4be6-8252-825956d28b95"
          }
        ]
      }
    ],
    "submitter": {
      "uid": "123456",
      "email": "joe@momshouse.com",
      "role": "allaroundgreatguy"
    }
  }
}

So the “Extract field metadata” button will obviously parse out the first level of objects (or arrays if retrieving the ‘list’) but what about the nested JSON objects and arrays of objects?

How can I create collections that represent the data in those nested objects and arrays? For example:

  • “fields” array might be a collection called ‘fields’ with a many-to-many or many-to-one association to the original collection.
  • “submitter” object might be an association to existing data…probably to the ‘users’ collection

Thanks ahead of time!