https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33503
Victor Grousset/tuxayo <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156304|0 |1 is obsolete| | --- Comment #6 from Victor Grousset/tuxayo <[email protected]> --- Created attachment 156312 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156312&action=edit Bug 33503 - Plugin OpenAPI2.0 specification schema fragments are not resolved. Merge full schema definitions. 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. If the api_spec is defined in the plugin, the api_routes-hook is never called. TEST PLAN: a) Run the modified test. or b) Install this plugin, and observe the routes are not loaded into the REST API. https://github.com/Hypernova-Oy/koha-plugin-self-service/releases/tag/v1.0.11 b1) Deploying this patch doesnt fix the plugin, as the whole subsystem to load OpenAPI2 spec has changed, and the plugins updated with workarounds. Plugins can be updated to support api_spec once it has been pushed. Signed-off-by: Victor Grousset/tuxayo <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
