Bug 17432

Summary: Remove requirement to minify swagger.json
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Web servicesAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: benjamin.rokseth, brendan, jonathan.druart, koha-bugs, lari.taskula, testopia, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17102
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
The minification of swagger.json is not more required; the deferenced version of the specification is now internally validated at runtime. Relavant errors output and the dereferenced schema has been made publically available at /api/v1/spec
Version(s) released in:
Circulation function:
Bug Depends on: 16212    
Bug Blocks: 17694    
Attachments: Bug 17432: Remove superflous minification
Bug 17432: Remove superflous minification
Bug 17432: Remove superflous minification
Bug 17432: Remove minification

Description Martin Renvoize (ashimema) 2016-10-12 12:02:02 UTC
This is an alternative to Bug #17102

Minification of the swagger.json file really serves no purpose.
Comment 1 Martin Renvoize (ashimema) 2016-10-12 12:06:16 UTC
Created attachment 56259 [details] [review]
Bug 17432: Remove superflous minification

The swagger specification file is currently superflously minified adding
manual steps to release management and restful api route development.
The minification is not required; The deferenced version of the
specification is now internally validated at runtime and relavant errors
output and the dereferenced schema has been made publically available at
/api/v1/spec
Comment 2 Martin Renvoize (ashimema) 2016-10-12 12:08:26 UTC
Removing this step should lower the onboarding time for developers wanting to work on RESTful api endpoints and also for those wishing to sign off and qa such bugs
Comment 3 Martin Renvoize (ashimema) 2016-10-12 12:13:30 UTC
Created attachment 56260 [details] [review]
Bug 17432: Remove superflous minification

The swagger specification file is currently superflously minified adding
manual steps to release management and restful api route development.
The minification is not required; The deferenced version of the
specification is now internally validated at runtime and relavant errors
output and the dereferenced schema has been made publically available at
/api/v1/spec

Test Plan
1) Apply patch
2) Ensure api routes still function (applying the /cities patch might be
    helpful)
3) Ensure /api/v1/spec page exists (it should be the de-referenced
    swagger.json file)
Comment 4 Claire Gravely 2016-10-12 12:27:09 UTC
Created attachment 56265 [details] [review]
Bug 17432: Remove superflous minification

The swagger specification file is currently superflously minified adding
manual steps to release management and restful api route development.
The minification is not required; The deferenced version of the
specification is now internally validated at runtime and relavant errors
output and the dereferenced schema has been made publically available at
/api/v1/spec

Test Plan
1) Apply patch
2) Ensure api routes still function (applying the /cities patch might be
    helpful)
3) Ensure /api/v1/spec page exists (it should be the de-referenced
    swagger.json file)

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Comment 5 Lari Taskula 2016-10-12 12:44:38 UTC
This is amazing! I wasn't aware that "spec_path" alone can make that. It makes the minificator useless and life easier for everyone.
Comment 6 Tomás Cohen Arazi (tcohen) 2016-10-12 12:47:16 UTC
Created attachment 56268 [details] [review]
Bug 17432: Remove minification

The swagger specification file is currently being minified adding
manual steps to release management and restful api route development.
The minification is not required; The deferenced version of the
specification is now internally validated at runtime and relavant errors
output and the dereferenced schema has been made publically available at
/api/v1/spec, so it can be copy&pasted into validation tools

Test Plan
1) Apply patch
2) Ensure api routes still function (applying the /cities patch might be
    helpful)
3) Ensure /api/v1/spec page exists (it should be the de-referenced
    swagger.json file)

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Brendan Gallagher 2016-10-12 13:41:50 UTC
Pushed to Master - Should be in the November 16.11 Release.  Thanks!
Comment 8 Katrin Fischer 2016-10-16 11:33:18 UTC
*** Bug 17102 has been marked as a duplicate of this bug. ***