Issue #1: Add a script for generating Swagger object definitions
This patch adds a script that uses DBIC schema definitions to generate Swagger object defintiions. It generates generic descriptions for the fields until we make a decision on extending our schema metadata with those descriptions or even put them in the DB backend using MySQL'1 COMMENT
It makes use of a template to generate its output because I belive we should keep the columns order for the swagger definition (documentation) so it became impossible to achieve by using JSON->to_json to output plain JSON data out of the hashref. Instead of that it uses arrays internally and use the template to arrange things.
Pretty printing is done by an external tool: jq, which needs to be installed for running the script. The script will die with a message if the jq binary is not in the path.
To test:
- Run: $ sudo koha-shell kohadev k$ cd kohaclone k$ ../misc4dev/koha_schema_to_swagger.pl --class BorrowerAttribute => SUCCESS: The expected swagger definition is printed on the terminal
Signed-off-by: Tomas Cohen Arazi tomascohen@theke.io