[Bug 33227] New: Swagger validation is failing for paths/biblios.yaml
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Bug ID: 33227 Summary: Swagger validation is failing for paths/biblios.yaml Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: pedro.amorim@ptfs-europe.com CC: agustinmoyano@theke.io, martin.renvoize@ptfs-europe.com, tomascohen@gmail.com Running swagger-cli validate swagger.yaml we get: Validation failed. /paths/biblios/post/parameters/Body has an invalid type (string,object) -- 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=33227 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Status|NEW |ASSIGNED Severity|enhancement |normal -- 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=33227 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 148213 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148213&action=edit Bug 32227: Unit tests This patch adds a unit test that launches the swagger-cli validator against our spec. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148213|0 |1 is obsolete| | --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 148214 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148214&action=edit Bug 33227: Unit tests This patch adds a unit test that launches the swagger-cli validator against our spec. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Swagger validation is |OpenAPI validation is |failing for |failing for |paths/biblios.yaml |paths/biblios.yaml -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This is great! It'll be a vast improvement to have our spec validated regularly like this :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Confirmed working from this end so feel free to add my stamp if you're ready, Tomas. Otherwise, I'll wait for the bug to go NSO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148214|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 148268 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148268&action=edit Bug 33227: Unit tests This patch adds a unit test that launches the swagger-cli validator against our spec. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 148269 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148269&action=edit Bug 33227: Remove invalid spec and adjust the code accordingly The spec contains a non-standard definition for the body param. Removing it from the spec makes us need to handle the 'body' manually in the case of JSON data. This patch basically does that. It also changes the uses of $c->validation, which are discouraged by the Mojolicious::Plugin::OpenAPI dev/maintainer. I do it to highlight what we must do in other places and the fact that there's no behavior change. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/biblios.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31800 See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31800 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31800 [Bug 31800] REST API: POST endpoint for Biblios -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |33250 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33250 [Bug 33250] DELETE /biblios/:biblio_id fails when ES is enabled -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148268|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148407 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148407&action=edit Bug 33227: Unit tests This patch adds a unit test that launches the swagger-cli validator against our spec. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148269|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148408 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148408&action=edit Bug 33227: Remove invalid spec and adjust the code accordingly The spec contains a non-standard definition for the body param. Removing it from the spec makes us need to handle the 'body' manually in the case of JSON data. This patch basically does that. It also changes the uses of $c->validation, which are discouraged by the Mojolicious::Plugin::OpenAPI dev/maintainer. I do it to highlight what we must do in other places and the fact that there's no behavior change. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/biblios.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This resolves the issues presented and causes now regressions. However, I'd love to see some documentation added somewhere to the API docs that states we expect MARC records to be passed (in various formats).. at the moment, the docs aren't all that clear. Anyways.. Passing QA to get us back on spec -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 148410 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148410&action=edit Bug 33227: (follow-up) Improve docs Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #148410|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148411 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148411&action=edit Bug 33227: (follow-up) Improve docs Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Bug 33227 depends on bug 31800, which changed state. Bug 31800 Summary: REST API: POST endpoint for Biblios https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31800 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.05.00 |23.05.00,22.11.04 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #13 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to stable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |33328 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33328 [Bug 33328] x-marc-schema should be renamed x-record-schema -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #14 from Lucas Gass <lucas@bywatersolutions.com> --- Doesn't apply cleanly in 22.05.x, if needed please rebase. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #15 from Jonathan Druart <jonathan.druart@gmail.com> --- xt/api.t is currently failing but the failure is hidden because we skip the test (swagger-cli is missing from the node_modules in ktd). Why not simply fail if missing? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I think I agree.. lets remove the SKIP set the test as failed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 168707 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168707&action=edit Bug 33227: (follow-up) Set test to failed if swagger-cli missing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm going to move that to it's own bug -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- See bug 37302 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33227 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168707|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org