yarn add -D openapi@^1.0.0 openapi-preset-effector
// openapi.config.js
module.exports = {
file: 'path to local or remote swagger v2 or v3 spec',
outputDir: 'relative path to generated api directory',
presets: ['openapi-preset-effector'],
};
// openapi.config.js
module.exports = {
file: 'path to local or remote swagger v2 or v3 spec',
outputDir: 'relative path to generated api directory',
presets: [
[
'openapi-preset-effector',
{
effectorImport: 'effector-root',
requestName: 'fetchFx',
requestPath: '../lib/fetch',
},
],
],
};
effectorImport
(default"effector"
) — what instance of the effector should be usedrequestName
(default"requestFx"
) — change base effect for the each requestrequestPath
(default"./request"
) — whether to import base request from
yarn openapi
# or
npx openapi
ls -la ./path-to-generated-api