Proposal for how to describe resources with Hydra to achieve search functionality using relative URL templates
The API Documentation describes a :UserCollection
class, which supports a search property :searchUsers
to have the collection filtered by constructing a URL Template <api/user-search-template>
. The template has a URL identifier to allow sharing it between the API Documentation and actual resources to filter.
Given the two example instances of the collection, the client would be able to construct URLs relative to the subject of :searchUsers
predicate like:
/users?first=John
/users/unverified?age=20
The <api/user-search-template> hydra:resolveRelativeTo hydra:LinkContext
triple is crucal enabler of that functionality