Suggestion: Generic OData response type
@nikithauc đang làm issue này rồi.
Từ ngày 5/4/2022.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
I think this library should include a type to match the OData response signature, as these properties are very important to consider in certain scenarios and I don't think the library consumer should have to define this type themselves or have to rely on another library.
Concretely, I suggest an implementation that ideally enables the following Angular code to compile
(this.http as HttpClient)
.get<ExampleODataType<User>>('https://graph.microsoft.com/v1.0/me')
.subscribe((response) => {
console.log(response['@odata.context']);
console.log(response.displayName);
});
(this.http as HttpClient)
.get<ExampleODataType<User[]>>('https://graph.microsoft.com/v1.0/users?$count')
.subscribe((response) => {
console.log(response['@odata.count']);
console.log(response['@odata.nextLink']);
console.log(response.value[0].displayName);
});
A simpler alternative to this could be a Type containing just the OData properties which one can make intersections with
(this.http as HttpClient)
.get<User & ExampleODataType>('https://graph.microsoft.com/v1.0/me')
.subscribe((response) => {
console.log(response['@odata.context']);
console.log(response.displayName);
});
(this.http as HttpClient)
.get<{ value: User[] } & ExampleODataType>('https://graph.microsoft.com/v1.0/users?$count')
.subscribe((response) => {
console.log(response['@odata.count']);
console.log(response['@odata.nextLink']);
console.log(response.value[0].displayName);
});
- Ngôn ngữ chính
- PowerShell
- Star
- 129
- Fork
- 35
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-typescript-typings
-
status:waiting-for-triage type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
microsoftgraph/msgraph-typescript-typings#756 · 1 reaction ·
-
status:waiting-for-triage type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-typescript-typings#748 · 2 reaction ·
-
status:waiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
-
status:waiting-for-triage type:feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
microsoftgraph/msgraph-typescript-typings#530 · 1 reaction ·