Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xtdev/swaggerv2-to-ts

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xtdev/swaggerv2-to-ts

将swagger V2.0 转换成TS接口服务

  • 0.0.17
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
4
Weekly downloads
 
Created
Source

@xtdev/swaggerv2-to-ts

一个将swagger v2.0 转换成TS接口服务工具

安装

    yarn @xtdev/swaggerv2-to-ts -D 或者
    npm install @xtdev/swaggerv2-to-ts -D

使用

    cd project-name
    npx swagger2ts start your-swagger-json-url

执行完成后,会在根目录下生成temp/service.ts目标文件;

确保根目录下处在temp文件夹(当然也可根据参数配置输出文件路径)

swagger2ts 参数

命令参数默认值备注
start'./temp/service.ts'生成输出文件路径(.ts结尾)
-p''指定需要生成的接口名称以【,】分割 (user/login,user/add)
-o./temp/service.ts生成输出文件路径(.ts结尾)

案例

npx swagger2ts start https://service.baidu.com/api/v2/api-docs -p /checkAccount/down,/checkAccount/quarterOptions -o ./tempService.ts

FAQs

Package last updated on 17 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc