Koha-clms/Koha/Exceptions
Tomas Cohen Arazi ab79f3fc67
Bug 21116: Add API routes through plugins
This patch adds plugins the capability of injecting new routes on the
API.

The plugins should provide the following methods to be considered valid API-generating plugins:

- 'api_routes': returning the 'path' component of the OpenAPI specification corresponding to the routes served by the plugin
- 'api_namespace': it should return a namespace to be used for grouping the endpoints provided by the plugin

otherwise, they will be just skipped.

All plugin-generated routes will be added the 'contrib' namespace, and
will end up placed inside /contrib/<namespace>, where <namespace> is what the 'api_namespace' returns.

A sample endpoint will be added to the Kitchen Sink plugin, and tests
are being written.

To test:
- Apply this patches
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
=> SUCCESS: Tests pass!
- Install the (latest) KitchenSink plugin
- Point your browser to the API like this:
  http://koha-intra.myDNSname.org:8081/api/v1/.html
=> SUCCESS: The /contrib/kitchensink/patrons/:patron_id/bother endpoint
implemented by the plugin has been merged!
- Sign off! :-D

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3fedae85f2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2018-09-20 12:09:27 +01:00
..
Patron Bug 17828: Overload Koha::Patron::Attribute->store to check for unique_id and repeatable 2017-03-31 14:36:47 +00:00
Authentication.pm Bug 18137: Add useful Koha::Exceptions 2017-09-21 11:27:04 -03:00
Authorization.pm Bug 18137: Add useful Koha::Exceptions 2017-09-21 11:27:04 -03:00
Config.pm Bug 19542: Add a check for ES configuration health 2017-12-11 14:30:42 -03:00
Exception.pm Bug 21022: (follow-up) Move overloaded full_message method to subclass 2018-07-15 21:44:11 +01:00
Ill.pm Bug 7317: Handle missing email addresses gracefuly 2017-11-09 11:42:15 -03:00
Object.pm Bug 21022: (follow-up) Move overloaded full_message method to subclass 2018-07-15 21:44:11 +01:00
Plugin.pm Bug 21116: Add API routes through plugins 2018-09-20 12:09:27 +01:00