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

--- Comment #5 from Kyle M Hall (khall) <[email protected]> ---
Created attachment 205436
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205436&action=edit
Bug 43491: REST API XML payload conversion breaks plugin API routes that read
XML

Bug 37762 makes the REST API convert request bodies sent with an
application/xml content type to JSON so they can be validated against
Koha's swagger definitions, and convert response bodies with an
application/xml content type from JSON to XML. Both hooks apply to
every route, including the /contrib plugin routes.

Plugins define their own API contracts and may consume and produce XML
directly. For example, the NCIP server plugin accepts NCIP XML messages
on its route. On Koha 26.05 and later the request hook replaces the
incoming NCIP message with a JSON rendering of it before the plugin
controller runs, destroying the message, and the response hook dies
trying to parse the plugin's XML response as JSON.

This patch skips both conversions for the contrib namespace, using the
same namespace detection as Koha::REST::V1::Auth. Core routes such as
the ISO18626 endpoint are unaffected.

Test Plan:
1) Apply the first patch
2) prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
3) Note the new 'XML payloads on plugin routes tests' subtest fails,
   the XML and JSON bodies come back mangled!
4) Apply this patch
5) prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
6) Note all tests pass!
7) prove t/db_dependent/api/v1/iso18626/request.t
8) Note the core XML conversion still works!

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to