commonsbooking
commonsbooking copied to clipboard
GBFS/Commons-API: Add filter hook for item processing
This has the goal to enable users of the cb plugin, to alter api responses for gbfs and commons-api requests. The motivation behind it: Item data of an instance can be many different things and endpoint response data has to be very specific. For example can an initiative lend bikes and cars, but the GBFS endpoint only should return data for bike items.
Long term goal: Through the power of filter hooks, each initiative can implement their own filter logic, if they need it. Without touching the core implementation, this shifts work from the core-team to the users.
Scope of a first implentation-step would be filter hooks. Scope of potential second step would be to implement it backed by the Options array, which then can be accessed easily via web interface.
TODO and thoughts on this PR:
- [ ] discuss filter names and filter apis
- [ ] Add filter hooks for all commons-api endpoints
- [ ] Filter for gbfs item processing. But it is buried in endpoint implementation and coupled. In contrast to the gbfs location processing, which is in the base impl.