[Bug 24577] New: API schema merging breaks with older versions of JSON module
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24577 Bug ID: 24577 Summary: API schema merging breaks with older versions of JSON module Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: andrew.isherwood@ptfs-europe.com I discovered this while deploying a plugin that defines an API route. If the installation is using a version of the JSON module < 2.90, schema merging doesn't work correctly, these are the sort of errors that were being generated during validation of the merged schema: { 'path' => '/paths/~1contrib~1ill_availability_unpaywall~1ill_availability_search_unpaywall/get/parameters/0', 'message' => 'oneOf failed: oneOf failed: Properties not allowed: type. oneOf failed: (Not in enum list: header.. Expected boolean - got JSON::XS::Boolean.) (Not in enum list: formData.. Expected boolean - got JSON::XS::Boolean.) Expected boolean - got JSON::XS::Boolean. (Expected boolean - got JSON::XS::Boolean.. Not in enum list: path.) Properties not allowed: name, required, type, description, in.' } Pretty nonsensical and a nightmare to try and get to the bottom of. I was seeing this using JSON 2.61. I believe the change that was implemented in 2.90 that we're dependent on, is the top one listed here: https://metacpan.org/changes/release/MAKAMAKA/JSON-2.90 Koha is currently specifying 2.07 as the required version. I'm wondering if it is worth moving this to 2.90. -- 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=24577 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- So.. we already require Mojolicious.. so I'd be tempted to switch to Mojo::JSON.. I believe it's the fastest pure perl implementation of JSON to date and it will automatically use Cpanel::JSON::XS when found to go faster still. It's also not introducing a new dependency, but rather using one we're already importing. Thoughts? -- 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=24577 --- Comment #2 from Andrew Isherwood <andrew.isherwood@ptfs-europe.com> --- Sounds like a possibility. Though I think we'd have to audit all 172 uses of the JSON module and ensure that a) Mojo::JSON fulfils all requirements (JSON does a lot) and b) has an straightforward migration path -- 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=24577 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Is this one still valid? -- 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=24577 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|NEW |RESOLVED --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pretty sure this is invalid now. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org