[Koha-bugs] [Bug 33503] New: Plugin OpenAPI2.0 specification schema fragments are not resolved. Merge full schema definitions.
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Apr 12 11:52:26 CEST 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33503
Bug ID: 33503
Summary: Plugin OpenAPI2.0 specification schema fragments are
not resolved. Merge full schema definitions.
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Plugin architecture
Assignee: koha-bugs at lists.koha-community.org
Reporter: olli-antti.kivilahti at hypernova.fi
QA Contact: testopia at bugs.koha-community.org
Koha::REST::Plugin::PluginRoutes.pm simply injects a plugin's OpenAPI2.0 route
definitions into the /paths -object.
Possibly after Bug 30194, dereferencing OpenAPI2.0 schema fragments/components
has started to fail.
This plugin:
https://github.com/Hypernova-Oy/koha-plugin-self-service/releases/tag/v1.0.11
used to get it's REST API paths injected and dereferenced/bundled correctly,
for Koha versions 22.05 and before, but in the new Koha version the same schema
definitions no longer work.
This patch adds a new plugin hook,
api_spec
which injects a full OpenAPI2.0 compatible schema into the full Koha schema,
avoiding to overwrite any existing definitions/parameters/info/paths/etc.
This way we maintain backwards compatibility with existing plugins, which are
not broken, and maintain updated plugins' ability to use complex schemas.
We need to inject full schema definitions, because of the way how the new
OpenAPI validator does dereferencing, by creating /parameters and /definitions
-objects inside the plugin's OpenAPI schema object. The api_route()-plugin hook
then proceeds to strip away only the paths/routes and loses the internal data
structure references to the schema fragments/components.
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list