Bug 852004 - json arrays representation
Summary: json arrays representation
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Michael Pasternak
QA Contact: Oded Ramraz
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-27 10:02 UTC by Gal Leibovici
Modified: 2014-01-13 00:37 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-27 10:15:00 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gal Leibovici 2012-08-27 10:02:44 UTC
In JSON API, representation of multiple similar objects are in arrays form,
is problematic.

For example,in entrypoint /api/hosts:
The XML for options under power_management is:
<options>
    <option name="port" value=""/>
    <option name="secure" value="false"/>
</options>

but the JSON representation is:
"options" : {
        "options" : [ {
          "name" : "port",
          "value" : ""
        }, {
          "name" : "secure",
          "value" : "false"
        } ]
      }

so options inside powerManagement is an object containing an "options" field which is an array of objects.

I think it should be that options field of powerManagement is an array of objects directly.

This is happening in other locations too, I think the code groups similar xml objects in a single json field with plural form name. in cases where it's the only type of elements, it should be grouped directly.

Comment 1 Michael Pasternak 2012-08-27 10:15:00 UTC
i'm aware of this issue, but this is schema modelling since 2.2
which cannot be changed in sake of backward compatibility


Note You need to log in before you can comment on or make changes to this bug.