RE: Typed vs generic collections

Hi Graham,

On Tuesday, November 8, 2016 10:23 PM, Graham Conzett wrote:
> In the events API the the collection of events is represented with an
> EventCollection class (type?) and in the Issues API example the Users
> and Issues are represented with a generic Hydra collection. The
> ApiDocumentation for EventCollection enumerates the operations that
> can be performed on that resource whereas the ApiDocumentation for the
> Issues API describes the operations that can be invoked on the users
> and issues properties in the context of the EntryPoint.
> 
> The benefit of the former seems to be that if you have a response for
> an EventCollection type, your ApiDocumentation can tell you what
> operations you can invoke on that resource, whereas if you have a
> response for issues or users, without the added context of the
> EntryPoint, you can't see your available operations without navigating
> back.

Absolutely correct.


> Is one of these implementations preferred over the other? Is there a

No


> benefit to using a generic Hydra Collection in the case of the Issues
> API? Anything wrong with making all your collections typed for the
> sake of always having contextual operations present?

We didn't specify client conformance criteria yet so there might be a risk
that a client would only recognize the generic Hydra Collection and wouldn't
know what to do with a specialization thereof.... unless you explicitly
express that this resource is both a Hydra Collection and a, e.g.,
EventCollection.


HTH,
Markus


--
Markus Lanthaler
@markuslanthaler

Received on Thursday, 10 November 2016 20:05:26 UTC