<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>A new request with request id 18329 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is : <br><br>Title : Koha-devel Digest, Vol 186, Issue 15<br>Category : <br>Description : <div>Send Koha-devel mailing list submissions to<br>    koha-devel@lists.koha-community.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>    https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>or, via email, send a message with subject or body 'help' to<br>    koha-devel-request@lists.koha-community.org<br><br>You can reach the person managing the list at<br>    koha-devel-owner@lists.koha-community.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Koha-devel digest..."<br><br><br>Today's Topics:<br><br>   1. PUT /holds/:hold_id (Tomas Cohen Arazi)<br>   2. Re: PUT /holds/:hold_id (dcook@prosentient.com.au)<br>   3. Re: PUT /holds/:hold_id (Arthur)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Mon, 17 May 2021 18:05:10 -0300<br>From: Tomas Cohen Arazi <tomascohen@gmail.com><br>To: koha-devel <koha-devel@lists.koha-community.org><br>Subject: [Koha-devel] PUT /holds/:hold_id<br>Message-ID:<br>    <CABZfb=XgSmWcip-KJO51duBaA3ERtCY-OQZ5uXWp7p6Uic1YhA@mail.gmail.com><br>Content-Type: text/plain; charset="utf-8"<br><br>Hi all, I wanted to gather some opinions about the mentioned route.<br><br>We've made sure all routes have the additionalProperties: false setting,<br>and some routes, like this one, don't have it. In the task to add it we<br>noticed:<br>1. Theroute doesn't work as expected: the documented attributes don't match<br>the coding guidelines (i.e. terminology hasn't been adjusted on the spec)<br>but it did in the code, it just works because we don't set<br>additionalProperties: false. TL;DR no one following the spec can use it.<br>2. The route seems to be wrong regarding how our RESTful implementation<br>works in the rest of the routes: PUT should get a Koha::Hold object for<br>updating it. Instead, it only 'accepts': 'priority', 'pickup_library_id'<br>and 'suspended_until'. If we wanted to allow to selectively change those<br>attributes, we should do a PATCH instead.<br>3. We already have individual routes for changing those things on the hold:<br>PUT /holds/:hold_id/pickup_location<br>PUT /holds/:hold_id/priority<br>POST /holds/:hold_id/suspension<br><br>The route itself doesn't work now. And any change will break things for<br>people 'using' it. And tests pass only because the spec is loose. The<br>options are:<br>- 'Fix' the route so the attributes match the code, i.e. change the spec as<br>bug 20006 intended to do.<br>- Leave it as-is (probably documenting it should not be used).<br>- Remove the route until we really need to implement that PUT for something.<br>- Make it a PATCH route, in which we could add new attributes without<br>breaking anyone's dev (besides the verb change, that should be advertised)<br>- Fully implement a PUT, making it mandatory to send all the attributes<br>(this would be an important breaking change).<br><br>I would vote removing it, or making it a PATCH route. But I still don't see<br>the use case in the UI, for the latter. Most places in Koha do atomic<br>updates for priority, pickup location or hold suspension for which we<br>clearly have routes already.<br><br>Looking forward to your comments.<br><br>-- <br>Tomás Cohen Arazi<br>Theke Solutions (http://theke.io)<br>✆ +54 9351 3513384<br>GPG: B2F3C15F<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20210517/20c74819/attachment-0001.htm><br><br>------------------------------<br><br>Message: 2<br>Date: Tue, 18 May 2021 13:31:03 +1000<br>From: <dcook@prosentient.com.au><br>To: "'Tomas Cohen Arazi'" <tomascohen@gmail.com>, "'koha-devel'"<br>    <koha-devel@lists.koha-community.org><br>Subject: Re: [Koha-devel] PUT /holds/:hold_id<br>Message-ID: <01bf01d74b96$3adabbb0$b0903310$@prosentient.com.au><br>Content-Type: text/plain; charset="utf-8"<br><br>I’m not sure that I have much to contribute. <br><br> <br><br>One comment I would have is… what is the threshold for creating a V2 of the REST API? <br><br> <br><br>And maybe a breaking change for the API is OK for a major version change in Koha but just not a minor version change? (That said, I’ve encountered breaking changes in PostgreSQL on minor version updates. They’re annoying, but they are a fact of life I suppose.)<br><br> <br><br>David Cook<br><br>Software Engineer<br><br>Prosentient Systems<br><br>Suite 7.03<br><br>6a Glen St<br><br>Milsons Point NSW 2061<br><br>Australia<br><br> <br><br>Office: 02 9212 0899<br><br>Online: 02 8005 0595<br><br> <br><br>From: Koha-devel <koha-devel-bounces@lists.koha-community.org> On Behalf Of Tomas Cohen Arazi<br>Sent: Tuesday, 18 May 2021 7:05 AM<br>To: koha-devel <koha-devel@lists.koha-community.org><br>Subject: [Koha-devel] PUT /holds/:hold_id<br><br> <br><br>Hi all, I wanted to gather some opinions about the mentioned route.<br><br> <br><br>We've made sure all routes have the additionalProperties: false setting, and some routes, like this one, don't have it. In the task to add it we noticed:<br><br>1. Theroute doesn't work as expected: the documented attributes don't match the coding guidelines (i.e. terminology hasn't been adjusted on the spec) but it did in the code, it just works because we don't set additionalProperties: false. TL;DR no one following the spec can use it.<br>2. The route seems to be wrong regarding how our RESTful implementation works in the rest of the routes: PUT should get a Koha::Hold object for updating it. Instead, it only 'accepts': 'priority', 'pickup_library_id' and 'suspended_until'. If we wanted to allow to selectively change those attributes, we should do a PATCH instead.<br>3. We already have individual routes for changing those things on the hold:<br>PUT /holds/:hold_id/pickup_location<br>PUT /holds/:hold_id/priority<br>POST /holds/:hold_id/suspension<br><br>The route itself doesn't work now. And any change will break things for people 'using' it. And tests pass only because the spec is loose. The options are:<br><br>- 'Fix' the route so the attributes match the code, i.e. change the spec as bug 20006 intended to do.<br><br>- Leave it as-is (probably documenting it should not be used).<br><br>- Remove the route until we really need to implement that PUT for something.<br><br>- Make it a PATCH route, in which we could add new attributes without breaking anyone's dev (besides the verb change, that should be advertised)<br><br>- Fully implement a PUT, making it mandatory to send all the attributes (this would be an important breaking change).<br><br> <br><br>I would vote removing it, or making it a PATCH route. But I still don't see the use case in the UI, for the latter. Most places in Koha do atomic updates for priority, pickup location or hold suspension for which we clearly have routes already.<br><br> <br><br>Looking forward to your comments.<br><br> <br><br>-- <br><br>Tomás Cohen Arazi<br><br>Theke Solutions (http://theke.io <http://theke.io/> )<br>✆ +54 9351 3513384<br>GPG: B2F3C15F<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20210518/17103125/attachment-0001.htm><br><br>------------------------------<br><br>Message: 3<br>Date: Tue, 18 May 2021 11:58:54 +0200<br>From: Arthur <arthur.suzuki@biblibre.com><br>To: koha-devel@lists.koha-community.org<br>Subject: Re: [Koha-devel] PUT /holds/:hold_id<br>Message-ID: <ea8a616e-d98f-d842-f1f9-8c1c72dcc102@biblibre.com><br>Content-Type: text/plain; charset="utf-8"<br><br>Hi Thomas, David,<br><br>I vote for making it a PATCH route and either document the PUT method as<br>"do-not-use" or making it a real "PUT".<br><br>In my opinion making the api a v2 is going to make things confusing for<br>consumers as there are already several web-services available for Koha<br>(ILS-DI, OAI-PMH, SRU, Rest...).<br><br>For each API version, consumer app must develop a new connector and a<br>mechanism to select which connector is appropriate to use, this is going<br>to be quite confusing + added complexity for api consumers.<br><br>Unnecessary complexity in my opinion.<br><br>Arthur Suzuki,<br><br>BibLibre Support Developper<br><br>On 18/05/2021 05:31, dcook@prosentient.com.au wrote:<br>><br>> I’m not sure that I have much to contribute.<br>><br>>  <br>><br>> One comment I would have is… what is the threshold for creating a V2<br>> of the REST API?<br>><br>>  <br>><br>> And maybe a breaking change for the API is OK for a major version<br>> change in Koha but just not a minor version change? (That said, I’ve<br>> encountered breaking changes in PostgreSQL on minor version updates.<br>> They’re annoying, but they are a fact of life I suppose.)<br>><br>>  <br>><br>> David Cook<br>><br>> Software Engineer<br>><br>> Prosentient Systems<br>><br>> Suite 7.03<br>><br>> 6a Glen St<br>><br>> Milsons Point NSW 2061<br>><br>> Australia<br>><br>>  <br>><br>> Office: 02 9212 0899<br>><br>> Online: 02 8005 0595<br>><br>>  <br>><br>> *From:*Koha-devel <koha-devel-bounces@lists.koha-community.org> *On<br>> Behalf Of *Tomas Cohen Arazi<br>> *Sent:* Tuesday, 18 May 2021 7:05 AM<br>> *To:* koha-devel <koha-devel@lists.koha-community.org><br>> *Subject:* [Koha-devel] PUT /holds/:hold_id<br>><br>>  <br>><br>> Hi all, I wanted to gather some opinions about the mentioned route.<br>><br>>  <br>><br>> We've made sure all routes have the additionalProperties: false<br>> setting, and some routes, like this one, don't have it. In the task to<br>> add it we noticed:<br>><br>> 1. Theroute doesn't work as expected: the documented attributes don't<br>> match the coding guidelines (i.e. terminology hasn't been adjusted on<br>> the spec) but it did in the code, it just works because we don't set<br>> additionalProperties: false. TL;DR no one following the spec can use it.<br>> 2. The route seems to be wrong regarding how our RESTful<br>> implementation works in the rest of the routes: PUT should get a<br>> Koha::Hold object for updating it. Instead, it only 'accepts':<br>> 'priority', 'pickup_library_id' and 'suspended_until'. If we wanted to<br>> allow to selectively change those attributes, we should do a PATCH<br>> instead.<br>> 3. We already have individual routes for changing those things on the<br>> hold:<br>> PUT /holds/:hold_id/pickup_location<br>> PUT /holds/:hold_id/priority<br>> POST /holds/:hold_id/suspension<br>><br>> The route itself doesn't work now. And any change will break things<br>> for people 'using' it. And tests pass only because the spec is loose.<br>> The options are:<br>><br>> - 'Fix' the route so the attributes match the code, i.e. change the<br>> spec as bug 20006 intended to do.<br>><br>> - Leave it as-is (probably documenting it should not be used).<br>><br>> - Remove the route until we really need to implement that PUT for<br>> something.<br>><br>> - Make it a PATCH route, in which we could add new attributes without<br>> breaking anyone's dev (besides the verb change, that should be advertised)<br>><br>> - Fully implement a PUT, making it mandatory to send all the<br>> attributes (this would be an important breaking change).<br>><br>>  <br>><br>> I would vote removing it, or making it a PATCH route. But I still<br>> don't see the use case in the UI, for the latter. Most places in Koha<br>> do atomic updates for priority, pickup location or hold suspension for<br>> which we clearly have routes already.<br>><br>>  <br>><br>> Looking forward to your comments.<br>><br>>  <br>><br>> -- <br>><br>> Tomás Cohen Arazi<br>><br>> Theke Solutions (http://theke.io <http://theke.io/>)<br>> ✆+54 9351 3513384<br>> GPG: B2F3C15F<br>><br>><br>> _______________________________________________<br>> Koha-devel mailing list<br>> Koha-devel@lists.koha-community.org<br>> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>> website : https://www.koha-community.org/<br>> git : https://git.koha-community.org/<br>> bugs : https://bugs.koha-community.org/<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20210518/3d021eb6/attachment.htm><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>Koha-devel mailing list<br>Koha-devel@lists.koha-community.org<br>https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>website : https://www.koha-community.org/<br>git : https://git.koha-community.org/<br>bugs : https://bugs.koha-community.org/<br><br><br>------------------------------<br><br>End of Koha-devel Digest, Vol 186, Issue 15<br>*******************************************<br></div><br><br>NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.<br></body></html>