Hi Marios, it can't hurt to add that sentence. I actually ran into that recently and was bugged that we needed a resourceURI at all for XML - I know that's the price we pay for using the same root element for all collections, but bleck! :-) Maybe for v2 we can convince folks (Gil) to use a collection-specific root element name.
I'd recommend opening a new issue since it is more than just a typo - should be a quick 2 minute discussion/vote. thanks -Doug ________________________________________________________ STSM | Standards Architect | IBM Software Group (919) 254-6905 | IBM 444-6905 | [email protected] The more I'm around some people, the more I like my dog. From: "[email protected]" <[email protected]> To: [email protected], Cc: [email protected], Doug Davis/Raleigh/IBM@IBMUS Date: 11/09/2012 11:11 AM Subject: Re: [PATCH 4/8] CIMI: toplevel collections must have a resourceURI attr in XML 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| >
