--
You received this message because you are subscribed to the Google Groups "Collection+JSON" group.
To unsubscribe from this group and stop receiving emails from it, send an email to collectionjso...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Ricardo:great to see your post here and always good to see people writing clients for Cj. ;)as to your Qs...1) "...What happens if the href is not provided? Is it to be included in the representation? Does it have a default value? This applies to the href property of 'items' too."- i include the element (link, query, item) with a default href of the current URL (href={self}). This is usually *Not* what authors intend (they usually just _forgot_ the href) but it is a way to continue to execute at runtime w/o throwing fatal errors."Is the following a valid representation of a collection+json document?
{
"collection": {}
}"docs say this is a minimal valid representation: http://amundsen.com/media-types/collection/examples/#ex-minimalbut the above is accepted by my parser by filling in the missing "version" as "1.0" and the missing href as the current URL of the request. Again, my goal is to not throw any fatal errors at runtime.
2) "...the use of MAY indicates that each property is optional, however 'name' is identified as required; which one is it?"yeah, bad spec writing there. "name" is REQUIRED for "data" elements. if it is missing I currently leave the data element out of the rendering. I considered generating a random unique value for "name", but rejected that idea. open to other thoughts.
3) "is it possible for two or more links or queries to have the same name property?"yes, it is possible and this would still be a valid document from the Cj POV. This is especially helpful for "data" elements but counter-intuitive for "link" and "query" elements. I haven't run into any runtime problems with it tho and have left this alone. open to other thoughts here, too.
please keep us posted on your progress.
3) "is it possible for two or more links or queries to have the same name property?"yes, it is possible and this would still be a valid document from the Cj POV. This is especially helpful for "data" elements but counter-intuitive for "link" and "query" elements. I haven't run into any runtime problems with it tho and have left this alone. open to other thoughts here, too.
For more options, visit https://groups.google.com/d/optout.
Each item in a Collection+JSON collection has an assigned URI (via the href property) and an optional array of one or more data elements along with an optional array of one or more link elements. Both arrays support a name property for each object in the collection in order to decorate these elements with domain-specific semantic information (e.g."data" : [{"name" : "first-name", ...},...]
).