iucogs / pubs

Publication management system
http://pubs.cogs.indiana.edu
4 stars 0 forks source link

Collections JSON output #17

Closed JaimieMurdock closed 11 years ago

JaimieMurdock commented 11 years ago

The collections API interface is dumping both the asssociative array's named indexes and the raw indexes ("0", "1", "2"). This can be seen as the values for "0" & "collection_id", "1" & "collection_name", etc. are the same.

{"0":"45", "collection_id":"45",
 "1":"SEP independence-large-cardinals","collection_name":"SEP independence-large-cardinals",
 "2":"105","user_id":"105",
 "3":"tgennaro","submitter":"tgennaro",
 "4":"sep","owner":"sep",
 "5":"5","citation_id":"5"}

http://pubs.cogs.indiana.edu/collection/45.json

Additionally, it is only displaying 1 citation_id as part of the collection. It should output a list of all citations in the collection. The datatypes for ids should also be integers (e.g., 45 instead of "45").

A cleaned up output would look like:
{"collection_id":45,
 "collection_name":"SEP independence-large-cardinals",
 "user_id":105,
 "submitter":"tgennaro",
 "owner":"sep",
 "citations":[12,45,67,954,22]}
pjcraig commented 11 years ago

I'll look into this tomorrow. I think the function we're using to get the collection data probably needs to be retooled.