Summary: | Migrate spec to OpenAPI v3 | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | REST API | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | ASSIGNED --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, jonathan.druart, lisette, martin.renvoize, thibaud.guillot, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35614 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36546 |
||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: |
Description
Tomás Cohen Arazi (tcohen)
2023-12-20 12:55:49 UTC
Awesome! 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? (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. 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. |