Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>swagger-to-tsNew to Visual Studio Code? Get it now.
swagger-to-ts

swagger-to-ts

farewing

|
366 installs
| (1) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

swagger-to-ts

通过 swagger schema 生成 ts 接口描述

⚠️ 使用前,请先配置 package.json 中的 swaggerUrl 字段,该字段为项目 swagger 接口地址。 格式如 ${host}/v2/api-docs c

"swaggerUrl": "http://xxx:port/v2/api-docs"

使用方式:

Typescript interface

鼠标选取需要生成的url, 然后 command + shift + p ,搜索「swagger-to-ts」关键字。 目前支持 GET PUT 请求方式。

mock

鼠标选取需要生成的url, 然后 command + shift + p ,搜索「swagger-to-mock」关键字。 目前支持 GET PUT 请求方式。

示例

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft