I'm trying to fetch items barcode via holds endpoint with no luck. If I've understood correctly, this should be possible by adding item as embed in /api/v1/swagger/paths/holds.yaml and then adding it to enum option in kohaTable function. However this only leads to following error: >Something went wrong when loading the table. >400: Bad Request. >Not in enum list: cancellation_requested, biblio, pickup_library, item. Documentation for endpoint shows that endpoint should produce item object and Koha::Hold does have relation to item.
It seems there is a typo in holds.yaml. Setting "collectionFormat: csv" is included inside "items" of "x-koha-embed". Fixing this allows me to add and call item as emded. However now some of my API calls fail on 500 error and Mojolicious compalains that "Not a HASH reference at /usr/share/perl5/SQL/Abstract/Classic.pm line 804".
(In reply to Emmi Takkinen from comment #1) > It seems there is a typo in holds.yaml. Setting "collectionFormat: csv" is > included inside "items" of "x-koha-embed". Fixing this allows me to add and > call item as emded. However now some of my API calls fail on 500 error and > Mojolicious compalains that "Not a HASH reference at > /usr/share/perl5/SQL/Abstract/Classic.pm line 804". This doesn't seem to be related to emded problem.
(In reply to Emmi Takkinen from comment #2) > (In reply to Emmi Takkinen from comment #1) > > It seems there is a typo in holds.yaml. Setting "collectionFormat: csv" is > > included inside "items" of "x-koha-embed". Fixing this allows me to add and > > call item as emded. However now some of my API calls fail on 500 error and > > Mojolicious compalains that "Not a HASH reference at > > /usr/share/perl5/SQL/Abstract/Classic.pm line 804". > > This doesn't seem to be related to emded problem. I mean, fixing this doesn't lead to 500 errors. Those are rather related how I'm building my table with API result. Fixing that typo allows using embed objects again.
Created attachment 169266 [details] [review] Bug 37032: Fix typo in holds.yaml There is a typo in holds.yaml which prevents fetching item as embeded object. Option "collectionFormat" should be under "x-koha-embed", not "items" array. To test prove t/db_dependent/api/v1/holds.t. Sponsored-by: Koha-Suomi Oy
I'm unsure what's proper testing method for this (other than running tests for holds.t). Please feel free to point out what else should be tested and I will adjust test plan accordingly.
Setting importance as normal since this prevents using endpoint with its full potential.
Created attachment 170463 [details] [review] Bug 37032: Fix typo in holds.yaml There is a typo in holds.yaml which prevents fetching item as embeded object. Option "collectionFormat" should be under "x-koha-embed", not "items" array. To test prove t/db_dependent/api/v1/holds.t. Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com>
Created attachment 170532 [details] [review] Bug 37032: Fix typo in holds.yaml There is a typo in holds.yaml which prevents fetching item as embeded object. Option "collectionFormat" should be under "x-koha-embed", not "items" array. To test prove t/db_dependent/api/v1/holds.t. Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Ooops, thanks Emmi
Pushed for 24.11! Well done everyone, thank you!
Backported to 24.05.x for upcoming 24.05.06
Pushed to 23.11.x for 23.11.11