Created
December 14, 2016 17:02
-
-
Save DragorWW/11e0bb33fb0c4711f114b9d463614d82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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