Alcaeus icon indicating copy to clipboard operation
Alcaeus copied to clipboard

Collection property not exposed with other properties

Open tpluscode opened this issue 5 years ago • 2 comments

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

tpluscode avatar Aug 23 '19 11:08 tpluscode

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()

tpluscode avatar Aug 23 '19 11:08 tpluscode

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.

thewilkybarkid avatar Nov 25 '19 10:11 thewilkybarkid