@easy-breezy/generator-api
Version:
RTK adapter generator from OpenAPI specification
66 lines (52 loc) • 1.38 kB
Markdown
## What is `-breezy/generator-api`?
`-breezy/generator-api` - This is the API adapter generation module using `@reduxjs/toolkit`. For the `-breezy/core` microframework.
The module generates adapter code using the OpenAPI 2 and OpenAPI 3 specifications.
The module generates schemas, typescript types, and `createApi` code for endpoints.
## Installation
You'll first need to install [-breezy/core](https://www.npmjs.com/package/@easy-breezy/core):
```sh
# npm
npm install -breezy/core --save-dev
# yarn
yarn add -breezy/core --dev
```
Next, install `-breezy/generator-api`:
```sh
# npm
npm install -breezy/generator-api --save-dev
# yarn
yarn add -breezy/generator-api --dev
```
## CLI Usage
If `-breezy/core` was set globally.
```sh
easy-breezy
# or
easybreezy
```
If `-breezy/core` has been installed locally then use your command.
Example:
```
// packages.json
{
// ...
"scrips": {
"generator": "easy-breezy"
}
}
```
```sh
# npm
npm run generator
# yarn
yarn generator
```
After starting, just follow the instructions in the `CLI`
## An example of the result of the generator.
The following file structure will be created
```
your-folder/
├─ your-api-endpoints/
├─ index.ts
├─ extension.ts // File for more detailed customization and expansion @reduxjs/toolkit `createApi`
```