swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

Can http-client.ts be customized?

Open DominiY opened this issue 1 year ago • 2 comments
trafficstars

Can http-client.ts be customized? Because wechat mini programs or other projects may not be axios or fetch.

I want to wrap a wx.request around it.

DominiY avatar Apr 15 '24 06:04 DominiY

Yes it can, quite easily. Use swagger-typescript-api generate-templates to get all the templates, and then use http-client.ejs to customize http-client.ts

woutervanvliet avatar Apr 24 '24 11:04 woutervanvliet

image

I use nodejs scripts to create ts files. you need to create your file structure like this and name the template file as http-client.ejs. The simplest way is to copy axios-http-client or fetch-http-client and rename it image

gaowujian avatar Jun 06 '24 16:06 gaowujian