You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by "Michal Fojtik (JIRA)" <ji...@apache.org> on 2013/01/03 14:20:14 UTC
[jira] [Resolved] (DTACLOUD-354) Inconsistent collection format in
JSON responses
[ https://issues.apache.org/jira/browse/DTACLOUD-354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michal Fojtik resolved DTACLOUD-354.
------------------------------------
Resolution: Fixed
Assignee: Michal Fojtik
> Inconsistent collection format in JSON responses
> ------------------------------------------------
>
> Key: DTACLOUD-354
> URL: https://issues.apache.org/jira/browse/DTACLOUD-354
> Project: DeltaCloud
> Issue Type: Bug
> Components: Server
> Reporter: Tomas Sedovic
> Assignee: Michal Fojtik
>
> Depending on the size of a Deltacloud resource collection (images, keys, actions, etc.) the JSON responses are not consistent.
> 0 images:
> Expected: {"images": []}
> Actual: {"images": null}
> 1 image:
> Expected: {"images": [{"id": "img1", "name": "Fedora 19", ...}]}
> Actual: {"images": {"image": {"id": "img1", "name": "Fedora 19", ...}}}
> more than 1 image:
> Expected: {"images": [{"id": "img1", "name": "Fedora 19", ...}, {"id": "img2", "name": "Fedora 18", ...}]}
> Actual: {"images": {"image": [{"id": "img1", "name": "Fedora 19", ...}, {"id": "img2", "name": "Fedora 18", ...}]}}
> (note that even when Deltacloud does return an array, the array is under "images"/"image" which isn't really ideal semantically)
> The current situation make it difficult to write clients that consume the JSON API because each client has to check the response if it's null/hash/array before using the data.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira