cc'ing Doug Davis here - Doug should I open a Mantis for this? (seems like minor editorial)
IMO, $subject isn't very clear in the spec... section 4.1.4 Media Types : "In the JSON serialization of CIMI representations sent by Providers there shall be an additional attribute on the root object called "resourceURI" that will contain the unique URI that is associated with the type of CIMI resource being serialized. " I think we can add a sentence here saying that the 'root' Collections must have a resourceURI for the XML serialization too. It *is* defined in the XML schema @ http://schemas.dmtf.org/cimi/1/dsp8009_1.0.1.xsd and shown in the example serialization under 5.5.12 Collections but is that clear enough? marios On 09/11/12 06:18, [email protected] wrote: > From: David Lutterkort <[email protected]> > > --- > server/lib/cimi/models/base.rb | 1 + > server/tests/cimi/spec_helper.rb | 5 ++++- > 2 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/server/lib/cimi/models/base.rb b/server/lib/cimi/models/base.rb > index 63b24ae..6a73cf6 100644 > --- a/server/lib/cimi/models/base.rb > +++ b/server/lib/cimi/models/base.rb > @@ -235,6 +235,7 @@ class CIMI::Model::Resource > def self.to_xml(model) > xml = @schema.to_xml(model) > xml["xmlns"] = CMWG_NAMESPACE > + xml["resourceURI"] = resource_uri > XmlSimple.xml_out(xml, :root_name => xml_tag_name) > end > > diff --git a/server/tests/cimi/spec_helper.rb > b/server/tests/cimi/spec_helper.rb > index e1f2ee4..e86eaee 100644 > --- a/server/tests/cimi/spec_helper.rb > +++ b/server/tests/cimi/spec_helper.rb > @@ -32,6 +32,9 @@ def parse_xml(xml, opts = {}) > end > > class HashCmp > + > + IGNORED_KEYS = [ "resourceURI" ] > + > def initialize(exp, act) > @exp = exp > @act = act > @@ -77,7 +80,7 @@ class HashCmp > unless (missing = exp.keys - act.keys).empty? > error "Missing key(s) at /#{path.join("/")}: #{missing.inspect}" > end > - unless (excess = act.keys - exp.keys).empty? > + unless (excess = act.keys - exp.keys - IGNORED_KEYS).empty? > error "Excess key(s) at /#{path.join("/")}: #{excess.inspect}" > end > (exp.keys - missing - excess).each do |k| >
