Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openapi/preset-effector
https://github.com/openapi/preset-effector
effector openapi swagger
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/openapi/preset-effector
- Owner: openapi
- License: mit
- Created: 2020-10-10T09:41:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-29T12:45:01.000Z (10 months ago)
- Last Synced: 2024-05-05T03:22:28.148Z (9 months ago)
- Topics: effector, openapi, swagger
- Language: JavaScript
- Homepage: https://npmjs.com/effector-openapi-preset
- Size: 452 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# openapi-preset-effector
## Usage
#### Install openapi and preset
```shell
yarn add -D openapi@^1.0.0 openapi-preset-effector
```#### Create config
```js
// 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'],
};
```#### Options
```js
// 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 used
- `requestName` (default `"requestFx"`) — change base effect for the each request
- `requestPath` (default `"./request"`) — whether to import base request from#### Run generation
```shell
yarn openapi
# or
npx openapi
```#### Review generated files
```shell
ls -la ./path-to-generated-api
```