0.0.1 • Published 6 years ago

swagger-axios-gencode v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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)
})

Links

License

MIT