I'm trying to pull some data into Drupal from a service, via Guzzle. I've got several clients like this working, but the data returned by this service is structured a bit differently:
{
pager: [ ],
row_count: 101,
data: {
"794": {
InventoryID: "794",
AddressID: "618"
},
"2318": {
InventoryID: "2318",
AddressID: "536"
}
}
}
A service description like this:
operations:
GetInventoryList:
httpMethod: "GET"
uri: "current-stock/inventory?_format=json"
summary: "Gets all current inventory items"
responseClass: "InventoryList"
models:
InventoryListItem:
type: "object"
location: "json"
properties:
InventoryID:
location: "json"
type: "string"
AddressID:
location: "json"
type: "string"
InventoryList:
type: "array"
location: "json"
items:
"$ref": "InventoryListItem"
...doesn't work, of course, because it targets the top level of the response. Is there a way to define the models so that the contents of the 'data' array are returned, rather than the top level array?