[Bug 31022] New: 400/404 actually returns 500
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022 Bug ID: 31022 Summary: 400/404 actually returns 500 Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart+koha@gmail.com CC: martin.renvoize@ptfs-europe.com, tomascohen@gmail.com Not sure if I am missing something, but I don't manage to get a 400 with the syntax we are using all around our REST API code. return $c->render( status => 400, openapi => { error => "this is an error" } ); I am getting a 500 with, in Koha logs: [{"message":"Missing property.","path":"\/body\/errors"}] So yes, it is working with: return $c->render( status => 400, openapi => { errors => [ {message => 'this is an error'}] } ); But it's not at all what we are doing in our REST API module. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- We narrowed this one down.. it's the patrons search (GET) we're looking at and it appears we're missing our local '400' definition in the spec file /paths/patrons.yaml -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Shouldn't we add the different errors for each route? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I do however find it really weird still that you can define more than one definition for the same response status on the endpoint... i.e. the internal 400 definitions for the validator software and then our own one for our own errors. I would have expected our definition to take precedence over the internal one and thus need it to be a superset of the built-in one. Interesting. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Martin Renvoize from comment #3)
I do however find it really weird still that you can define more than one definition for the same response status on the endpoint...
i.e. the internal 400 definitions for the validator software and then our own one for our own errors.
I would have expected our definition to take precedence over the internal one and thus need it to be a superset of the built-in one.
Interesting.
Doesn't our definition just overload the default/internal one? It used to return a 500 because it wasn't considered a valid response in the spec, which I find correct. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Ok, tested myself, this is some Mojolicious::Plugin::OpenAPI bug. Reported it: https://github.com/jhthorsen/mojolicious-plugin-openapi/issues/237 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Tomás Cohen Arazi from comment #5)
Ok, tested myself, this is some Mojolicious::Plugin::OpenAPI bug.
Reported it: https://github.com/jhthorsen/mojolicious-plugin-openapi/issues/237
I see that the bug has been closed - anything we can do here now? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org