Keystone's xml serializer addresses this just as you describe. Given the original JSON, it would produce:<div><br></div><div>    <cloudpipes></div><div>        <cloudpipe project_id="<u></u>b7f6d49c12714e96a05fada4aba4ea<u></u>d6" ...etc... /></div>
<div>    </cloudpipes><div><br></div><div>By recognizing that A) "cloudpipes" *looks* plural, and B) it refers to a list of stuff, so assume that "cloudpipe" is the child element by convention (after checking for hardcoded exceptions):</div>
<div><br></div><div>    <a href="https://github.com/openstack/keystone/blob/master/keystone/common/serializer.py#L170">https://github.com/openstack/keystone/blob/master/keystone/common/serializer.py#L170</a><br clear="all">
<div><br></div>-Dolph<br>
<br><br><div class="gmail_quote">On Wed, Sep 26, 2012 at 8:26 AM, Sean Dague <span dir="ltr"><<a href="mailto:sdague@linux.vnet.ibm.com" target="_blank">sdague@linux.vnet.ibm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 09/25/2012 05:00 PM, Vishvananda Ishaya wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey Mauro,<br>
<br>
I don't think it is acceptable to change the json representation. If we need a different representation to make xml work, then we will just have to translate back and forth. An alternative (and probably better) option would be to change the json representation but have it also accept and convert the old json representation. We really can't break an interface that people are already using.<br>

<br>
And yes, changing the test to actually do a real xml request would be preferrable.<br>
<br>
Vish<br>
<br>
On Sep 25, 2012, at 12:54 PM, Mauro Rodrigues <<a href="mailto:maurosr@linux.vnet.ibm.com" target="_blank">maurosr@linux.vnet.ibm.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi guys, how are you doing?<br>
<br>
Well, I'm working on API samples to Cloudpipe extension[1]. To JSON it works just fine, although when using XML it works partially. what do I mean?<br>
For JSON, when creating a cloudpipe, the response comes with the follow:<br>
{ "instance_id": "8250f384-ee8a-43b7-9eb2-<u></u>453e5bbdd019" }<br>
So using XML I was waiting the same information, looking like this:<br>
<br>
<instance_id>ff1f7847-2bd3-<u></u>4385-9bbe-d273cea01ba4</<u></u>instance_id><br>
<br>
Instead I got just a empty string.<br>
<br>
A similar problem occurs when trying to list cloudpipes, to Json we had the follow response:<br>
{<br>
    "cloudpipes": [<br>
        {<br>
            "project_id": "<u></u>b7f6d49c12714e96a05fada4aba4ea<u></u>d6",<br>
            "internal_ip": "10.0.0.2",<br>
            "public_ip": "192.168.1.100",<br>
            "public_port": 8000,<br>
            "state": "running",<br>
            "instance_id": "8250f384-ee8a-43b7-9eb2-<u></u>453e5bbdd019",<br>
            "created_at": "1981-10-20T00:00:00Z"<br>
        },<br>
    ]<br>
}<br>
<br>
For XML only:<br>
<cloudpipes><br>
<cloudpipe/><br>
</cloudpipes><br>
</blockquote></blockquote>
<br></div></div>
Does this just mean the XML serializer doesn't do anonymous dictionaries? Seems like in those cases we could put a work around in the XML serializer to handle this instead of changing the JSON.<br>
<br>
Also something to flag for future API calls that anonymous dictionaries should be avoided because of this kind of challenge. Probably worth adding a comment and bug around it and linking to this blueprint - <a href="https://blueprints.launchpad.net/nova/+spec/v2-api-inconsistencies" target="_blank">https://blueprints.launchpad.<u></u>net/nova/+spec/v2-api-<u></u>inconsistencies</a>.<span class="HOEnZb"><font color="#888888"><br>

<br>
        -Sean<br>
<br>
-- <br>
Sean Dague<br>
IBM Linux Technology Center<br>
email: <a href="mailto:sdague@linux.vnet.ibm.com" target="_blank">sdague@linux.vnet.ibm.com</a><br>
alt-email: <a href="mailto:sldague@us.ibm.com" target="_blank">sldague@us.ibm.com</a></font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
______________________________<u></u>_________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.<u></u>org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a><br>
</div></div></blockquote></div><br></div></div>