[Koha-devel] REST api enhancement to ease development
Tomas Cohen Arazi
tomascohen at gmail.com
Wed Oct 4 21:13:38 CEST 2017
Hi, we've been involved in a small discussion about a way to generalize
query parameters handling (with the focus on making it easier to write new
endpoints, and repeat code less).
In the process I declared some 'reserved' keywords that are clearly
described on each related bug.
I put things together from some of those conversations in bug 19410. This
probably explains the dependencies:
https://bugs.koha-community.org/bugzilla3/showdependencygraph.cgi?id=18731
Follow the dependencies to better track what's done so far.
Here you can see it "in action" on the list_orders controller method:
https://github.com/tomascohen/koha/blob/bug_18731_orders_endpoint/Koha/REST/V1/Acquisitions/Orders.pm#L26-L52
And this is how the OpenAPI path definition looks like with the 'reserved'
params:
https://github.com/tomascohen/koha/blob/bug_18731_orders_endpoint/api/v1/swagger/paths/acquisitions_orders.json#L35-L42
And the parameters definition [1]:
https://github.com/tomascohen/koha/blob/bug_18731_orders_endpoint/api/v1/swagger/parameters.json#L17-L50
Thanks in advance for your feedback and testing.
[1] Yes, there's room for modularization (parameters/reserved.json?). Help
is welcome.
--
Tomás Cohen Arazi
Theke Solutions (https://theke.io <http://theke.io/>)
✆ +54 9351 3513384
GPG: B2F3C15F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20171004/ab06799d/attachment.html>
More information about the Koha-devel
mailing list