Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>api2typeNew to Visual Studio Code? Get it now.
api2type

api2type

wangliang

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

初始化插件配置,设置 swagger 地址

ctrl+shift+p 输入api2type后选中填入swagger地址,如 http://******:8080/swagger/sp

根据所选api生成constants常量

在swagger中复制api地址,如/api/sp/manscpImageView/search

在需要生成的文件中右键选择根据所选api生成constants常量后自动插入

/** ****** */
export const URL_SP_MANSCPIMAGEVIEW_SEARCH = '/api/sp/manscpImageView/search';

根据所选api生成ts类型

在swagger中复制api地址,如/api/sp/manscpImageView/search

在需要生成的文件中右键选择根据所选api生成ts类型后自动生成到剪贴板中,在文件中粘贴

export interface RequestType {
  /** ****** */
  layoutKowakuId: string;
  /** ****** */
  prodAppNum: string;
}

export interface ResponseType {
  /** ****** */
  honsshaName: string;
  /** ****** */
  mediaName: string;
  /** ****** */
  kanNameMenu: string;
  /** ****** */
  postRegionalName: string;
  /** ****** */
  adHonsshaNameKanji: string;
  /** ****** */
  appTitle: string;
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft