Manweill / swagger-axios-codegen

swagger client to use axios and typescript
MIT License
306 stars 83 forks source link

我想axios resolve(res),该怎么配置 #144

Closed hemocy closed 3 years ago

hemocy commented 3 years ago

由于项目之前都是resove(res),现在换用这个导出的api,返回的和以前不同,代码要改的地方太多。有没有方法或者配置项修改? image

Manweill commented 3 years ago

你这个应该是跟144同一个需求,不过我暂时没时间调整。先归到一类去。或者你们可以自己PR

Manweill commented 3 years ago

如果你不考虑返回结果的提示话,可以直接在 axiosClient.interceptors.response.use里面做处理

hemocy commented 3 years ago

还有个问题,生成的api返回值都是Promise any $ref没有生效一样 swaggerv3版本 image 这个$ref,生成代码后 image ,如何生成正确的res.data类型,而不是都是any? 盼回复~thx

Manweill commented 3 years ago

image

应该是这个的原因,这里需要是 application/json

hemocy commented 3 years ago

感谢大佬,have a nice day!