Suggestion: Generic OData response type
@nikithauc y travaille déjà.
Depuis le 5/4/2022.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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);
});
- Langage dominant
- PowerShell
- Étoiles
- 129
- Forks
- 35
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoftgraph/msgraph-typescript-typings
-
status:waiting-for-triage type:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 48/100
microsoftgraph/msgraph-typescript-typings#756 · 1 réaction ·
-
status:waiting-for-triage type:bug
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
microsoftgraph/msgraph-typescript-typings#748 · 2 réactions ·
-
status:waiting-for-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 48/100
-
status:waiting-for-triage type:feature
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
microsoftgraph/msgraph-typescript-typings#530 · 1 réaction ·
Toutes les issues de microsoftgraph/msgraph-typescript-typings