Patrons endpoint help needed
Hi everyone, I've submitted a patchset to bug 19784 [1]. This is my starting point for the umbrella bug (19774). Next endpoints to fix are /acquisitions/vendors, /cities, /holds and /illrequests. Those are easier IMHO. On the /patrons one, I already changed - borrowernumber -> patron_id - branchcode -> library_id - categorycode -> category_id The needed code for this (or any) attribute rename is already done. The remaining work is mostly adding the mappings we would like to add, to the _to_model and _to_api functions. I now need help from you on the parameter names (patrons have really misleading attribute names, and they don't match the UI most of the time). Please comment here, and preferably on the bug itself. If you contribute a patch for your proposed change, please add a test on the specific attribute on one of the GET tests too. We try to cover all the special cases with tests. Ah, snake case was picked at some point, so 'cardnumber' could become 'card_number', for example. Thanks for any input. [1] https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19784 -- Tomás Cohen Arazi Theke Solutions (https://theke.io <http://theke.io/>) ✆ +54 9351 3513384 GPG: B2F3C15F
I forgot to mention we have coding guidelines for the REST api [1] which say the terminology we use, should be the less Koha-specific we can. Please keep that in mind! Thanks! [1] https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#SWAGGER1.2:_Res... El vie., 8 dic. 2017 a las 11:27, Tomas Cohen Arazi (<tomascohen@gmail.com>) escribió:
Hi everyone, I've submitted a patchset to bug 19784 [1]. This is my starting point for the umbrella bug (19774). Next endpoints to fix are /acquisitions/vendors, /cities, /holds and /illrequests. Those are easier IMHO.
On the /patrons one, I already changed - borrowernumber -> patron_id - branchcode -> library_id - categorycode -> category_id
The needed code for this (or any) attribute rename is already done. The remaining work is mostly adding the mappings we would like to add, to the _to_model and _to_api functions.
I now need help from you on the parameter names (patrons have really misleading attribute names, and they don't match the UI most of the time). Please comment here, and preferably on the bug itself. If you contribute a patch for your proposed change, please add a test on the specific attribute on one of the GET tests too. We try to cover all the special cases with tests.
Ah, snake case was picked at some point, so 'cardnumber' could become 'card_number', for example.
Thanks for any input.
[1] https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19784 -- Tomás Cohen Arazi Theke Solutions (https://theke.io <http://theke.io/>) ✆ +54 9351 3513384 <+54%209%20351%20351-3384> GPG: B2F3C15F
-- Tomás Cohen Arazi Theke Solutions (https://theke.io <http://theke.io/>) ✆ +54 9351 3513384 GPG: B2F3C15F
participants (1)
-
Tomas Cohen Arazi