Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 839 Bytes

README.md

File metadata and controls

35 lines (23 loc) · 839 Bytes

swagger-to-code

一个将swagger接口解析并生成typescript代码。

特性

  • 支持多个swagger
  • 支持泛型类型
  • 生成接口请求代码
  • 生成实体接口类型
  • fetch工厂函数

Tip: 目前处于开发阶段,许多功能暂未实现。

安装

Note: 创建名为swagger.json的配置文件, 在项目的根目录。

{
    "swagger-urls": ["https://petstore.swagger.io/v2/swagger.json"]
}

使用

  • 寻找接口 (Cmd+Alt+i on macOS or Ctrl+Alt+i on Windows and Linux)
  • 寻找实体 (Cmd+Alt+e on macOS or Ctrl+Alt+e on Windows and Linux)

更多信息

Enjoy!