You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it’s not possible to list routes in a collection.
PUT /collection/resource1
PUT /collection/resource2/_hook/route
GET /collection/resource2 => HookHandler -> Forwarder
GET /collection => Resource storage => { "collection": [ "resource1" ] }
In order to be able to list routes in a collection, we have to adapt the HookHandler. This way a request to a parent collection will check, if routes exist and if so, list them properly. Therefor the HookHandler takes control of creating the listing, if a route - handled by the HookHandler – is present (not the Router), otherwise the Router takes control.
PUT /collection/resource1
PUT /collection/resource2/_hook/route
GET /collection/resource2 => HookHandler -> Forwarder
GET /collection => HookHandler -> Resource Storage + Route hook list => { "collection": [ "resource1", "resource2" ] }
Extend the configuration of Hooks for Routes with two new attributes ‘listable’ and ‘collection’.
listable => if true routes will be shown, otherwise not (current behavior)
collection => because it’s not visible by an URL, if it points to a collection or a resource, we need to specify if the rout is a collection (default) or a resource. This is necessary if the listable feature is used with for example the expand feature.
{ "destination": .., // as usual
"listable": false, // new, allows to override the default
"collection": false } // new, indicates if route points to collection or resource.
We also need a new constructor, which allows to set the default for the listable feature: new HookHandler(...., true) // enable / disable listable as default
The text was updated successfully, but these errors were encountered:
Currently it’s not possible to list routes in a collection.
In order to be able to list routes in a collection, we have to adapt the HookHandler. This way a request to a parent collection will check, if routes exist and if so, list them properly. Therefor the HookHandler takes control of creating the listing, if a route - handled by the HookHandler – is present (not the Router), otherwise the Router takes control.
Extend the configuration of Hooks for Routes with two new attributes ‘listable’ and ‘collection’.
listable => if true routes will be shown, otherwise not (current behavior)
collection => because it’s not visible by an URL, if it points to a collection or a resource, we need to specify if the rout is a collection (default) or a resource. This is necessary if the listable feature is used with for example the expand feature.
We also need a new constructor, which allows to set the default for the listable feature:
new HookHandler(...., true) // enable / disable listable as default
The text was updated successfully, but these errors were encountered: