Ah - that would be a bug  :-)
The example in 4.1.10 was just out of sync with the Machine JSON.  Will 
fix.  thanks

thanks
-Doug
______________________________________________________
STSM |  Standards Architect  |  IBM Software Group
(919) 254-6905  |  IBM 444-6905  |  d...@us.ibm.com
The more I'm around some people, the more I like my dog.



David Lutterkort <lut...@redhat.com> 
11/03/2011 01:23 PM

To
Doug Davis/Raleigh/IBM@IBMUS
cc
deltacloud-dev@incubator.apache.org
Subject
Re: Sketch of CIMI model layer






On Thu, 2011-11-03 at 12:52 -0400, Doug Davis wrote:
> David Lutterkort <lut...@redhat.com> wrote on 11/03/2011 12:36:35 PM:
> ...
> > 
> > The issue really isn't so much that there is this small difference
> > between JSON and XML, but that the rules for the JSON/XML 
correspondence
> > aren't spelled out. Sections 4.1.9 and 4.1.10 in the WIP talk a little
> > bit about that, but a slightly more formal (structural induction or 
so)
> > set of rules would definitely ease the mind of any implementor. BTW,
> > 4.1.10 contradicts the examples later on, like the one on page 37 for 
a
> > MachineTemplate - 4.1.10 talks about a wrapper property, whereas the
> > examples don't have one.
> 
> can you elaborate on the mismatch between 4.1.10 and MachineTemplate?
> Which part of MachineTemplate is missing a wrapper?  I'd like to fix it.

In the WIP[1], section 4.1.10 says that arrays are serialized with a
wrapper property

        "volumes" : [
           { "volume": { "href": string },
             "attachmentPoint": string,
             "protocol": string } + ], ?

Whereas the example on page 39 has

        { "uri": string,
          "name": string,
          ...
          "volumes": [
            { "href": string, "attachmentPoint": string, "protocol": 
string }, + ], ?
          ... }

I actually think the second form is a little nicer than the first one;
you'd write 'volumes[0].href' rather than 'volumes[0].volume.href'. For
serializing back to XML, the second form also seems preferrable, since
the serialization only needs to follow two rules

      * an array property p is serialized as a sequence of elements
        whose name is the singular of the array property name ('volumes'
        -> 'volume')
      * properties of p[i] that are marked as XML attributes in the
        schema are serialized as attributes on the enclosing tag
        (<volume href='...'>)
      * properties of p[i] that are not marked as XML attributes are
        serialized as child elements.

I am sure you can come up with similar rules for the first form, though
they aren't quiteas obvious to me ;)

David

[1] 
http://dmtf.org/sites/default/files/standards/documents/DSP0263_1.0.0a.pdf


Reply via email to