{"action":"created","issue":{"url":"https://api.github.com/repos/RESTful-Drupal/restful/issues/532","labels_url":"https://api.github.com/repos/RESTful-Drupal/restful/issues/532/labels{/name}","comments_url":"https://api.github.com/repos/RESTful-Drupal/restful/issues/532/comments","events_url":"https://api.github.com/repos/RESTful-Drupal/restful/issues/532/events","html_url":"https://github.com/RESTful-Drupal/restful/issues/532","id":87826686,"number":532,"title":"Taxonomy term is an object instead of array?","user":{"login":"timwood","id":91050,"avatar_url":"https://avatars.githubusercontent.com/u/91050?v=3","gravatar_id":"","url":"https://api.github.com/users/timwood","html_url":"https://github.com/timwood","followers_url":"https://api.github.com/users/timwood/followers","following_url":"https://api.github.com/users/timwood/following{/other_user}","gists_url":"https://api.github.com/users/timwood/gists{/gist_id}","starred_url":"https://api.github.com/users/timwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timwood/subscriptions","organizations_url":"https://api.github.com/users/timwood/orgs","repos_url":"https://api.github.com/users/timwood/repos","events_url":"https://api.github.com/users/timwood/events{/privacy}","received_events_url":"https://api.github.com/users/timwood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-12T19:25:47Z","updated_at":"2015-06-12T20:10:12Z","closed_at":null,"body":"In a node-based API, I was attempting to customize the field output of a referenced taxonomy term using a function similar to imageProcess from some of the example code that ships with the module. Unfortunately when I try this I get the following error:\r\n> Argument 1 passed to RestfulBase::isArrayNumeric() must be an array, object given\r\n\r\nWhen debugging the variable output seems to be an array of the referenced terms but each term is an object instead of another array. In comparison when debugging the variable output for image (file entity) seems to be an array and each file is another array, not an object (screenshots from Krumo below). Any idea what might be causing this? Should I convert the objects into an array as suggested in https://github.com/RESTful-Drupal/restful/issues/353#issuecomment-80144333 ?\r\n\r\nThis is the code I'm using:\r\n```php\r\n    $public_fields['categories'] = array(\r\n      'property' => 'field_categories',\r\n      'process_callbacks' => array(\r\n        array($this, 'termProcess'),\r\n      ),\r\n    );\r\n```\r\n```php\r\n  protected function termProcess($value) {\r\n    if (static::isArrayNumeric($value)) { \r\n      $output = array();\r\n      foreach ($value as $item) { \r\n        $output[] = $this->termProcess($item);\r\n      } \r\n      return $output;\r\n    } \r\n    return array(\r\n      'id' => $value['tid'],\r\n      'self' => $value['uri'],\r\n      'label' => $value['name'],\r\n    );\r\n  }\r\n```\r\n\r\nTerm:\r\n![screen shot 2015-06-12 at 3 21 09 pm](https://cloud.githubusercontent.com/assets/91050/8138223/ee5e21d8-1116-11e5-97b1-67ae1b24403f.png)\r\n\r\nFile:\r\n![screen shot 2015-06-12 at 3 22 24 pm](https://cloud.githubusercontent.com/assets/91050/8138227/f75ed502-1116-11e5-90e6-2adfe7df328f.png)\r\n\r\nI'm using RESTFul module version 1.0 release from Drupal.org. Thanks for any help."},"comment":{"url":"https://api.github.com/repos/RESTful-Drupal/restful/issues/comments/111602177","html_url":"https://github.com/RESTful-Drupal/restful/issues/532#issuecomment-111602177","issue_url":"https://api.github.com/repos/RESTful-Drupal/restful/issues/532","id":111602177,"user":{"login":"timwood","id":91050,"avatar_url":"https://avatars.githubusercontent.com/u/91050?v=3","gravatar_id":"","url":"https://api.github.com/users/timwood","html_url":"https://github.com/timwood","followers_url":"https://api.github.com/users/timwood/followers","following_url":"https://api.github.com/users/timwood/following{/other_user}","gists_url":"https://api.github.com/users/timwood/gists{/gist_id}","starred_url":"https://api.github.com/users/timwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timwood/subscriptions","organizations_url":"https://api.github.com/users/timwood/orgs","repos_url":"https://api.github.com/users/timwood/repos","events_url":"https://api.github.com/users/timwood/events{/privacy}","received_events_url":"https://api.github.com/users/timwood/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T20:10:12Z","updated_at":"2015-06-12T20:10:12Z","body":"Looks like the suggestion in https://github.com/RESTful-Drupal/restful/issues/353#issuecomment-80144333 works! Also, I didn't realized the term doesn't include an uri or url, so obviously that field doesn't work in the second part of my code.\r\n\r\nStill curious if anyone knows why the term object is so different.\r\n\r\nAlso, is there some recommended way to output a link to a corresponding API for referenced objects. Like if I had an API of terms or image file entities?"}}