UNPKG

swagger-json-schema-request

Version:

通过Yapi JSON Schema生成接口Axios或Taro接口

8 lines (6 loc) 344 B
import CreateApi from './../src/index'; import path from 'path'; const source = path.join(__dirname, './../example/yapi.json'); const apiPath = path.join(__dirname, './../api/'); const SwaggerJsonSchemaRequest = new CreateApi(source, 'taro', {host: 'https://yapi.yashili.com/mock/178'}); SwaggerJsonSchemaRequest.generateFile(apiPath);