Yehuda:
Good to see your post here.
If I understand you correctly, you are proposing something that looks
like this (high-level view):
// sample collection object
{
"collection" :
{
"version" : "1.0",
"href" : URI,
"links" : [ARRAY],
"items" : [ARRAY],
"additional" :{OBJECT}, // <-- a single "inline" collection
"queries" : [ARRAY],
"template" : {OBJECT},
"error" : {OBJECT}
}
}
Is that right? Any reason we should consider this as an array of one
or more inline collections?
"additional" : [ARRAY], // <-- an array of "inline" collection
> Not quite. The additional key is a hash of additional content whose keys areso, using your first example: additional[many[0].href] returns the
> URIs. This means that the link between the content is the same as a regular
> HTTP link.
"inline collection", right?
1) are you sure you want to use a URL for this and not an internal id or rel?
2) i see the "name", "href", and "length" for the "many" object. are
there other possible values that would appear here?
3) you have "many" as an array - does that mean you see possible
multiple "inline collections" in a single response representation?
4) it seems like the only difference between the links:[] array for an
item and the many:[] array for an item is that one is inline, the
other is not. maybe we just need a decoration on the links:[] items to
indicate that the link can be used to find the inline collection.
On Apr 30, 2012 12:48 PM, "mca" <m...@amundsen.com> wrote:
>
> quick follow up.
>
> is the length property needed on the link(many) item?
> collection.item.length returns this, right (or
> inline[links[x].href].items.length)?
>
Yes, but again, the goal is to make the inline embedding optional. It's essentially just a preloaded resource, so the main resource should work agnostically of any prefetched embedded content.
The inline extension looks like a smart optimization. But I don't really understand the length property. Since the embedded collection is an object, can't I simply check how many items the collection contains? Or does it have some other purpose?
Also, is the href "http://example.org/comments/1,2,3,4" supposed to be a valid URL? As in, if I'd execute that URL, should I expect the same collection as the one that was preloaded?
--
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.
I think it's important not to fall into the trap of thinking about "objects" or "strong types" here.