Bug 34333 added the ability to embed cancellation requests information on the holds endpoint, but the `collectionFormat` attribute got misaligned, making the feature unusable. This is hard to catch. Steps to reproduce: 1. Open your favourite REST tool 2. Make this request: GET http://kohadev-intra.myDNSname.org:8081/api/v1/patrons/42/holds x-koha-embed: cancellation_requested => SUCCESS: Probably empty result, but not an error 3. Make this change: $ git diff diff --git a/api/v1/swagger/paths/patrons_holds.yaml b/api/v1/swagger/paths/patrons_holds.yaml index e8e1335a87d..c70d3359c41 100644 --- a/api/v1/swagger/paths/patrons_holds.yaml +++ b/api/v1/swagger/paths/patrons_holds.yaml @@ -24,6 +24,7 @@ type: string enum: - cancellation_requested + - pickup_library collectionFormat: csv produces: - application/json 4. Restart plack: $ ktd --shell k$ koha-plack --restart kohadev 5. Repeat 2 => SUCCESS: Same thing 6. Amend the request like this: GET http://kohadev-intra.myDNSname.org:8081/api/v1/patrons/42/holds x-koha-embed: cancellation_requested,pickup_library => FAIL: You get this, which is weird because it matches exactly what's in the x-koha-embed `enum`: { "errors": [ { "message": "Not in enum list: cancellation_requested, pickup_library.", "path": "/x-koha-embed/0" } ], "status": 400 } This is related to bug 35614.
Created attachment 160353 [details] [review] Bug 35658: Fix misaligned collectionFormat in patron_holds.yaml This patch fixes a silly typo. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Upping severity, I lost hours on this...
I am sorry, holidays got in the way - it's next on my 'push list' already.
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.02
Backported to 23.05.x for upcoming 23.05.08