Skip to content

Instantly share code, notes, and snippets.

@DragorWW
Created December 14, 2016 17:02
Show Gist options
  • Select an option

  • Save DragorWW/11e0bb33fb0c4711f114b9d463614d82 to your computer and use it in GitHub Desktop.

Select an option

Save DragorWW/11e0bb33fb0c4711f114b9d463614d82 to your computer and use it in GitHub Desktop.
var jsonToFlow = require('json-to-flow');
var path = require('path');
var schema = require('./swagger.json').definitions;
var _ = require('lodash');
var schemata = _(schema)
.mapValues('properties')
.value();
jsonToFlow(schemata, {
templateData: {
modelSuperClass: 'Model',
modelSuperClassPath: 'models/_model'
},
targetPath: path.join(__dirname, 'models'),
templateExtension: '.flow.js',
}, function(err, results) {
if (err) return console.error(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment