acacode / acacode/swagger-typescript-api

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

Đang mở
#330 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
4.1k
Fork
436
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.