https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21116

Tomás Cohen Arazi <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #77601|0                           |1
        is obsolete|                            |

--- Comment #7 from Tomás Cohen Arazi <[email protected]> ---
Created attachment 78195
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78195&action=edit
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 <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to