/redux-action-generator

A tool for generating redux action and interface ts code from swagger

Primary LanguageTypeScript

Redux Action Generator

Build Status codecov License

This tool can generate redux request actions and related interface from swagger.

it can avoid duplicate of template code for redux request actions.

Configuration

create a new json file named ts-codegen.config.json in your project root directory

{
  // your output directory
  "output": ".output",
  // import your own requestActionCreator
  "actionCreatorImport": "import { createRequestAction } from 'examples/requestActionCreators';\n\n",
  // your project swagger online address
  "clients": ["https://app.swaggerhub.com/apiproxy/registry/teobler/integration-example/1.0.0"],
  // swagger offline file path
  "data": ["./examples/swagger.json"]
}

Start

  1. npm install
  2. Configure your own ts-codegen.config.json
  3. Run cli ts-codegen