[Bug 35613] New: Migrate spec to OpenAPI v3
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35613 Bug ID: 35613 Summary: Migrate spec to OpenAPI v3 Change sponsored?: --- Product: Koha Version: 22.11 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com CC: tomascohen@gmail.com Things to do: - Convert our spec into OpenAPIv3 (probably using redocly) - Migrate array types ("type" and "null") into using the "nullable": true provided attribute - Verify no regressions found - Report potential issues to https://github.com/jhthorsen/mojolicious-plugin-openapi - Split the bundled spec into pieces as we have now. - The generated api.koha-community.org documentation needs to be at least the same in terms of information and usability. -- 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=35613 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |jonathan.druart+koha@gmail. | |com, | |martin.renvoize@ptfs-europe | |.com Version|22.11 |master -- 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=35613 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Awesome! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35613 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35614 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35613 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36546 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35613 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |thibaud.guillot@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35613 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #2 from David Cook <dcook@prosentient.com.au> --- How would this affect Koha plugins that add plugin routes? Will we just need to make an announcement that all plugins will need to be updated from Koha version xx.yy? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35613 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35613 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35613 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to David Cook from comment #2)
How would this affect Koha plugins that add plugin routes?
A new plugin hook will be added for v3, and plugins not implementing it won't expose an API. A warning should be added in the plugin page.
Will we just need to make an announcement that all plugins will need to be updated from Koha version xx.yy?
Exactly. Instructions will be provided for plugin authors to leverage on things like ChatGPT for the migration. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35613 --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- An update on the status of this report. What we have is this process for migrating: * Bundle the API spec (`yarn api:bundle` inside KTD should be enough) * Have VScode with the `openapi-lint` extension installed * Open the bundled spec in VSCode * Use Ctrl+shift+p/Cmd+shift+p to open the keyboard shortcuts menu * Choose OpenAPI 2.0 to 3.0.0 (YAML/Resolved) and get the spec converted This yields a new file. Then, inside KTD, you can run `redocly split` to get the API spec split the way it is in Koha right now, just v3. I'll provide a patch next week with the required changes to V1.pm. A good thing is that the `nullable: true` attribute and getting rid of the dual values we had in OpenAPI v2 is solved with this sequence. So that step is no longer required. It would be worth spending some time checking the options `redocy` provides for doing the sequence in the CLI. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org