[Koha-bugs] [Bug 32923] x-koha-embed must a header of collectionFormat csv

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 16 19:34:52 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32923

Pedro Amorim <pedro.amorim at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pedro.amorim at ptfs-europe.co
                   |                            |m

--- Comment #11 from Pedro Amorim <pedro.amorim at ptfs-europe.com> ---
(In reply to Jonathan Druart from comment #10)
> Created attachment 146633 [details] [review]
> Bug 32923: Fix x-koha-embed from EHoldings/*/*
> 
> We were validating twice the input and it broke the x-koha-embed header.
> I don't really know what's happening, but here is how to recreate the
> problem:
> 1. Edit Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm
> 2. Add the following lines in Koha/REST/V1/ERM/EHoldings/Packages/EBSCO.pm,
> in the list method
>     warn $c->req->headers->header('x-koha-embed');
> 3. curl -v -s -u koha:koha --request GET
> http://kohadev-intra.mydnsname.org:8081/api/v1/erm/eholdings/ebsco/packages
> --header "x-koha-embed: resources+count,vendor"
> 
> => There is no vendor in the response
> => The warn displays "resources+count"
> 
> If you apply this patch you will notice that "vendor" is part of the
> response and the warn displays "resources+count, vendor"

Did a lot of testing with this but openapi->valid_input in EBSCO.pm is getting
rid of all arguments in the x-koha-embed header except the first one.
Lot of trial and error in erm_eholdings_packages.yaml also came up with no
breakthrough.
Found this fix related to default collectionFormat in version 5.06 (we're using
5.05) so upgraded to Mojolicious::Plugin::OpenAPI to 5.08 but result is the
same:
https://github.com/jhthorsen/mojolicious-plugin-openapi/commit/c972fdd02a05dc635257715a4b8c541b218e2817

This weird behaviour seems to be caused by mojo. The code implemented to work
around this is working as intended.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list