https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43460 --- Comment #38 from David Cook <dcook@prosentient.com.au> --- (In reply to Pedro Amorim (ammopt) from comment #35)
On opt-in vs opt-out: before 37762 Koha core didn't accept generic application/xml payloads (MARCXML has its own content type and isn't affected). The intent was for them to be first-class in the REST API, validated against the same OpenAPI spec as JSON, so controllers don't need to care which format came in. For that to hold for every route without extra setup, the conversion is the default.
Now that I think about it... this sounds like a shortcoming of Mojolicious::Plugin::OpenAPI really... or our misunderstanding of it... Take a look at https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-OpenAPI-5.12/view/... openapi.parse_request_body $hash_ref = $c->openapi->parse_request_body; Returns a structure representing the request body. The default is to parse the input as JSON: {content_type => "application/json", exists => !!$c->req->body_size, value => $c->req->json}; This method is useful to override, in case you want to parse some other structure than JSON. So... I reckon that might be a better way of doing it... -- You are receiving this mail because: You are watching all bug changes.