Bug 30194: Adapt Koha to the latest JSON::Validator version
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 8 Mar 2022 15:56:48 +0000 (12:56 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 29 Mar 2022 14:44:31 +0000 (16:44 +0200)
commitd6092daa54a079f560cc33f4726fd26afa1866ac
tree2be26a27a8893c98a9de5a2c5225e073d667e3ec
parent619fc83cbe95543c69d9922f5b8b38b35ca9e60f
Bug 30194: Adapt Koha to the latest JSON::Validator version

This patch makes V1.pm and PluginRoutes.pm work with the
JSON::Validator breaking changes introduced after v4.

JSON::Validator got stricter, and it seems there's some bug in how it
resolves references, so I propose we bundle the YAML spec into a single
file using a gulp task. This will save load time too, so has its
advantages too.

To test:
1. Edit /etc/apt/sources.list.d/koha.list
2. Duplicate the existing line below, replacing 'dev' for 'exp'
3. Upgrade the packages
   $ apt update ; apt dist-upgrade -y
4. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t \
           t/db_dependent/api/v1
=> SUCCESS: Tests pass!
5. Restart plack and check the logs:
   $ koha-plack --restart kohadev ; tail -f /var/log/koha/kohadev/*.log
=> SUCCESS: Nothing seems broken, things work
6. Point your browser to http://localhost:8081/api/v1/
=> SUCCESS: The API is loaded
7. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/REST/Plugin/PluginRoutes.pm
Koha/REST/V1.pm
t/db_dependent/Koha/REST/Plugin/PluginRoutes.t
t/db_dependent/Koha/REST/V1.t