acacode / acacode/swagger-typescript-api

Define instance member properties in class 'HttpClient ' as instance member methods

未关闭
#330 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
4.1k
派生
436
PR 合并指标
30 天内没有已合并 PR

描述

Instead of rewriting the templates, I want to be able to extend the underlying HttpClient class, e.g.:

```
class ApiWithErrorHandling extends Api {

async request(params: FullRequestParams): Promise> {
try {
return super.request(params);
} catch (e) {
// do error handling (e.g. logout)
throw e;
}
}

}
```

which results in the following error:

`Class 'Api ' defines instance member property 'request', but extended class 'ApiWithErrorHandling' defines it as instance member function.`

Is there any reason, why the HttpClient class is designed that way?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。