| Summary: | missing Content-Type / HTTP 415 check for POST requests to /api/v1/patrons | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Hans <divinity76> |
| Component: | REST API | Assignee: | Bugs List <koha-bugs> |
| Status: | NEW --- | QA Contact: | |
| Severity: | trivial | ||
| Priority: | P5 - low | CC: | jonathan.druart, tomascohen |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32637 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
|
Description
Hans
2021-11-29 19:43:52 UTC
We rely on the Mojolicious::Plugin::OpenAPI library to validate requests based on our OpenAPI 2.0 spec. I'll try to check if there's a way to avoid this fallback behavior in the spec, but I haven't found anything yet. So, we depend on the library to take care of this situation. I am expecting this to be enough, but apparently the spec validation is not working here.
diff --git a/api/v1/swagger/paths/patrons.yaml b/api/v1/swagger/paths/patrons.yaml
index 1100a9fba96..493be03d507 100644
--- a/api/v1/swagger/paths/patrons.yaml
+++ b/api/v1/swagger/paths/patrons.yaml
@@ -6,6 +6,8 @@
tags:
- patrons
summary: List patrons
+ consumes:
+ - application/json
produces:
- application/json
parameters:
(tried with GET instead of POST, but that's the same) (In reply to Jonathan Druart from comment #4) > Is this https://github.com/jhthorsen/mojolicious-plugin-openapi/issues/209 ? Well, almost... """ Please ask on IRC or open an issue if you found a bug, as this issue if for v3. (Sorry, but I’m unsure what you try to point out in the last comment) """ |