How do i get parent ID of a taxonomy term? When i try to get data using the JSON API module, the field parent is always empty even if a term hierarchy exists.

For example, for a request to http://mysite.local/jsonapi/taxonomy_term/my_vocabulary/1a2a1fc1-b6d8-40be-a482-766ccab4aed1?_format=api_json&amp;include=vid,parent, part of the response is the following one.

"parent":{  
        "data":[  

        ]
     },


How can I fix it?
See this core issue: https://www.drupal.org/node/2543726

This will address this. Right now, parent is a special pseudo-field that only supports saving parent relationships but not actually loading them. That's why serialization doesn't work.

You would have to write your own serializer that uses the getParents methods of the taxonomy_term storage to load the data