Alcaeus
Alcaeus copied to clipboard
Collection property not exposed with other properties
Hydra vocabulary clearly states that hydra:collection
is a hydra:Link
. Whatever tool performs the assertion regarding hydra vocabulary must understand it's semantics.
Originally posted by @alien-mcl in https://github.com/HydraCG/api-examples/pull/8
The problem is that a resource's getProperties()
method looks for supported properties of declared type and not other predicates.
Unless hydra:collection
is used as a supported property of a class, it will not be returned by getLinks()
After a bit of debugging, this seems to be related to https://github.com/libero/article-store/pull/49#issuecomment-557595736 (where hydra:collection
is a supported property). The supported hydra:collection
is returned from getLinks()
, and the actual hydra:collection
implementation is returned from getCollections()
. The GHA joins them together in https://github.com/hypermedia-app/generic.hypermedia.app/blob/fe0982539e099b870c9503679ddb1153c3aa8f40/src/components/resource-views/alcaeus-resource-viewer.ts#L250-L284 leading to the duplication.