https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43491
Bug ID: 43491
Summary: REST API XML payload conversion breaks plugin API
routes that read XML
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: REST API
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected]
Target Milestone: ---
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 and may consume and produce XML directly. I've
been working on a plugin based version of the NCIP server for Koha, with NCIP
being entirely XML based.
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. The conversion
drops element attributes and ordering, so the original message can't be rebuilt
from it. In my case it's the attributes that are needed.
I have found a workaround by grabbing the raw body from the buffered PSGI input
Mojolicious's $c variable.
In the other direction, the response hook dies trying to parse the plugin's XML
response as JSON, turning it into a 500.
This affects Koha 26.05+
--
You are receiving this mail because:
You are the assignee for the bug.
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/