[openstack-dev] [Openstack] [nova] Call for Help -- OpenStack API XML Support
Kevin L. Mitchell
kevin.mitchell at rackspace.com
Fri Aug 10 14:57:29 UTC 2012
On Fri, 2012-08-10 at 13:47 +0100, Daniel P. Berrange wrote:
> I don't know this area of Nova code at all, but I must say I'm
> surprised that it actually needs explicit extra work to accept
> or output XML, instead of JSON. It should be possible to auto
> generate an XML document from a JSON document, and vica-verca.
> At which point you'd not need to have 2 sets of tests for JSON
> vs XML, all you need test is the XML<->JSON conversions.
Unfortunately, it's not at all that simple. The XML spec and JSON spec
are not precisely identical matches in all respects, so a mindless
translation is insufficient to generate XML compliant with our spec. It
is possible to build a translator to XML—see for example the XML
Templates code I contributed—but I certainly wouldn't call it simple.
This is one of the reasons I favor dropping XML from the next spec
(v3?).
> If we can get to a position where we auto-generate XML from JSON for Nova,
> we could do the same for other projects too
While this would represent an ideal situation, I'm not 100% convinced
yet that this can actually be done. Also, don't forget that we have to
deal with the deserialization side as well; our current deserialization
method is hand-coded XML tree walkers that convert string values to
their expected representation.
--
Kevin L. Mitchell <kevin.mitchell at rackspace.com>
More information about the OpenStack-dev
mailing list