Include number of items in the relationships

Hi,

I have an API exposing some artists with relationships to tracks and albums. I would like to return the number of items in the relationships (that is the number of albums and tracks for the given artist) at the /artist endpoint level, although not including the full results from the relationships.

What would be the best way to do it in the JSON API spec?
Thanks!

These count values should be placed within the meta field which is where one should be putting non-standard information. http://jsonapi.org/format/#document-meta

1 Like