https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42595 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 199111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199111&action=edit Bug 42595: Add render_error helper and fix bare string responses This patch adds a render_error helper to Koha::REST::Plugin::Responses that enforces the error object contract (status + error_code mandatory, error message optional). It then uses the helper to fix the three bare string error responses in Koha::REST::V1::Holds that caused OpenAPI response validation to produce 500 errors. Test plan: 1. Apply the regression test patch (previous commit) 2. Run: $ ktd --shell k$ prove xt/api.t => FAIL: Detects bare strings in Holds.pm 3. Apply this patch 4. Run: k$ prove xt/api.t t/db_dependent/api/v1/holds.t t/db_dependent/api/v1/responses.t => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.