0.0.13 • Published 5 years ago
openapi-to-client v0.0.13
根据openapi.json 生成 typescript 客户端
install
npm install openapi-to-client
use
By local file :
import * as openapi from './openapi.json';
const {render} = require('openapi-to-client')
render({
outputDir: __dirname + '/out',
openapiJson: openapi
})
// 将生成文件到/out目录下
OR
By remote url :
const {render} = require('openapi-to-client')
render({
outputDir: __dirname + '/out',
openapiUrl: 'http://localhost:3000/openapi.json'
})
// 将生成文件到/out目录下