swagger-axios-gencode
v0.0.1
Published
Swagger to JS Axios Codegen
Downloads
4
Readme
swagger-vue
Swagger to JS & Vue & Axios Codegen Fork Form https://github.com/chenweiqun/swagger-vue
Installation
npm install swagger-axios-codegen
Example
const swaggerGen = require('swagger-axios-codegen')
const jsonData = require('../api-docs.json')
const fs = require('fs')
const path = require('path')
let opt = {
swagger: jsonData,
moduleName: 'api',
className: 'api'
}
const codeResult = swaggerGen(opt)
codeResult.forEach(x => {
fs.writeFileSync(path.join(__dirname, `../dist/${x.tag}.js`), x.template)
})