deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michal Fojtik (JIRA)" <>
Subject [jira] [Created] (DTACLOUD-499) The 'ref' attributes are not (de)serialized propertly
Date Tue, 26 Feb 2013 11:12:13 GMT
Michal Fojtik created DTACLOUD-499:

             Summary: The 'ref' attributes are not (de)serialized propertly
                 Key: DTACLOUD-499
             Project: DeltaCloud
          Issue Type: Bug
          Components: CIMI/Frontend
            Reporter: Michal Fojtik
            Assignee: David Lutterkort

If you have this definition in CIMI model (MachineTemplate in this case):

array :volume_templates do
  ref :volume_template

and you use this JSON in .from_json method to create an instance of the MachineTemplate:

'volume_templates' : [
  { 'volumeConfig' : { 'capacity' : '12345' } }

The resulting 'machine_template.volume_templates.first.volume_config.capacity' will be 'nil'.

I tried to play a bit with the input JSON and I found that if you use this:

'volume_templates' : [
  'volume_template' : {
    { 'volumeConfig' : { 'capacity' : '12345' } }

The resulting 'machine_template.volume_templates.first.volume_template.capacity' is set properly
to '12345' :-)

The XML output then looks like:




I think we need to do something smart in the 'array' to remove the upper 'volumeTemplate'
or introduce something like 'ref_arr :volume_templates'.

Anyway, I'm leaving this one to you David, as you might have better schema knowledge than
me ;-)

CC'ing Dies, as he reported this issue original in his email.

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:

View raw message