Generate Swagger v2 Specification JSON schema from mysql tables. This is forked and refactoring from https://github.com/okunishinishi/node-mysqlspec
npm install https://github.com/480/mysql2swagger.git --save-dev
Describe database data.
var mysql2swagger = require('mysql2swagger');
// Mysql connect config.
var config = {
user: 'root',
password: 'my_password',
host: 'localhost',
database: 'my_db'
};
// Get spec for connected database
mysql2swagger(config, "DatabaseName", "TableName", function (err, schema) {
console.log(JSON.stringify(schema, null, 4));
});
This software is released under the MIT License.