song-yinan / swaggertoTs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

  • 遵循swagger2.0规范
  • 支持swagger文档导出TS类型
  • 支持批量导出类型
  • 支持自定义导出目录地址

Usage

  • Install with npm:
   npm i -g swaggertoTs
  • Install with pnpm:
  pnpm i -g swaggertoTs
  • Install with yarn:
  yarn i -g swaggertoTs
  • cogfig
    • 在项目根目录建立swgToTs.config.json文件
    {
      "urls": [/**  swaggerJSON文档地址*/ "http://example/.../api-docs"],
      "output": "./types" /** 输出TS类型目录地址 */
    }
  • 项目package.json配置运行命令
      ...
           "scripts": {
               "swaggertoTs": "swaggertoTs"
           }
      ...
    

About


Languages

Language:JavaScript 100.0%