@xbdtb/api-gen
v1.0.27
Published
generate client code from openapi document
Downloads
5
Maintainers
Readme
Install
# npm
npm install @xbdtb/api-gen --dev
# yarn
yarn add @xbdtb/api-gen --dev
Configuration
// config.js
module.exports = {
api: {
// url or file path
schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json',
serversPath: './src/services/generated',
},
another: {
// url or file path
schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json',
serversPath: './src/services/generated',
excludeServices: ['login'],
},
};
Run
// generate.js
const { generateByConfig } = require('@xbdtb/api-gen');
const config = require(__dirname + '/config.js');
generateByConfig(config);