user bookmark categories

11 views
Skip to first unread message

Stefan Kersten

unread,
Oct 16, 2012, 1:58:51 PM10/16/12
to freeso...@googlegroups.com
hi again,

probably a documentation bug:

http://www.freesound.org/docs/api/resources.html#sound-get-response

states that for /people/<username>/bookmark_categories "The response is an array.", but the API call returns an object

{
"num_results": 0,
"categories": []
}

i personally think that it would be better to return an array, but it's probably cheaper to fix the docs than the API ;)

<sk>

frederic font corbera

unread,
Oct 17, 2012, 5:45:38 AM10/17/12
to freeso...@googlegroups.com
Hello Stephan,

this is a documentation bug. The idea is that all resources that retrieve lists or paginated lists of objects return a dictionary with the total number of objects ("num_results"), and the actual objects as an array inside the dictionary (in the bookmark categories case, under "categories" array). In the case of paginated results this dictionary also contains the "next", "previous" and "num_pages" properties, and "num_results" correspond to the total number of objects including all pages, not only the current one.

probably in queries whose results are not paginated it does not make that sense to return the dictionary, but for the sake of unification we decided to do it that way!


frederic
> --
>
>
>

Stefan Kersten

unread,
Oct 17, 2012, 5:50:48 AM10/17/12
to freeso...@googlegroups.com
hi frederic,

On 17.10.2012, at 11:45, frederic font corbera wrote:
> this is a documentation bug. The idea is that all resources that retrieve lists or paginated lists of objects return a dictionary with the total number of objects ("num_results"), and the actual objects as an array inside the dictionary (in the bookmark categories case, under "categories" array). In the case of paginated results this dictionary also contains the "next", "previous" and "num_pages" properties, and "num_results" correspond to the total number of objects including all pages, not only the current one.

ah ok, makes sense. so just to clarify, can the bookmark categories be paginated, or are they always returned in a flat list within the response object?

<sk>

frederic font corbera

unread,
Oct 17, 2012, 7:53:41 AM10/17/12
to freeso...@googlegroups.com
hi stefan,

bookmark categories are never paginated.


frederic
> --
>
>
>

Reply all
Reply to author
Forward
0 new messages