[Koha-bugs] [Bug 16212] Swagger specification separation and minification

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jun 30 15:33:05 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16212

Johanna Räisä <johanna.raisa at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #52955|0                           |1
        is obsolete|                            |

--- Comment #21 from Johanna Räisä <johanna.raisa at gmail.com> ---
Created attachment 52973
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52973&action=edit
Bug 16212: Automatically minify swagger.json

This patch adds automatic minification of swagger.json. Since startup
subroutine
is executed on each call to REST API, we need to be careful to not do useless
computation by minificating swagger.json when not required. Therefore, we need
some algorithm to determine whether minification is needed. In this patch,
minification is executed in two cases:
1. swagger.min.json does not exist
2. any of the specification files is modified more recently than
   swagger.min.json

Includes tests.

This feature requires Apache user to have write permissions to
swagger.min.json,
otherwise we cannot minify the specification automatically. Another solution is
to run the minifySwagger.pl manually after each modification or create a daemon
that listens to file modifications via "inotify" and executes minification when
needed.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti at jns.fi>

My name is Olli-Antti Kivilahti and I approve this commit.
We have been using the Swagger2.0-driven REST API on Mojolicious for 1 year now
in production and I am certain we have a pretty good idea on how to work with
the limitations of Swagger2.0

Signed-off-by: Johanna Raisa <johanna.raisa at gmail.com>

My name is Johanna Räisä and I approve this commit.
We have been using Swagger2.0-driven REST API in production successfully.

-- 
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