microsoftgraph / microsoftgraph/msgraph-beta-sdk-java
Permissions error response not deserialized correctly
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 32
- Forks
- 14
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 6
Beschreibung
Expected behavior
API calls with errors should return a useable error response.
Actual behavior
An exception is thrown while parsing the permission error response:
com.microsoft.graph.beta.models.odataerrors.ODataError:
at com.microsoft.graph.beta.models.odataerrors.ODataError.createFromDiscriminatorValue(ODataError.java:36) ~[microsoft-graph-beta-6.5.1.jar:na]
at com.microsoft.kiota.serialization.JsonParseNode.getObjectValue(JsonParseNode.java:211) ~[microsoft-kiota-serialization-json-1.1.2.jar:na]
at com.microsoft.kiota.http.OkHttpRequestAdapter.lambda$throwIfFailedResponse$0(OkHttpRequestAdapter.java:674) ~[microsoft-kiota-http-okHttp-1.1.2.jar:na]
at com.microsoft.kiota.ApiExceptionBuilder.<init>(ApiExceptionBuilder.java:26) ~[microsoft-kiota-abstractions-1.1.2.jar:na]
at com.microsoft.kiota.http.OkHttpRequestAdapter.throwIfFailedResponse(OkHttpRequestAdapter.java:673) ~[microsoft-kiota-http-okHttp-1.1.2.jar:na]
at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:281) ~[microsoft-kiota-http-okHttp-1.1.2.jar:na]
at com.microsoft.graph.beta.security.informationprotection.sensitivitylabels.SensitivityLabelsRequestBuilder.get(SensitivityLabelsRequestBuilder.java:120) ~[microsoft-graph-beta-6.5.1.jar:na]
Steps to reproduce the behavior
- Use any sdk versions 6.3.0 to 6.5.1
- Using client secret credentials, call a graph api which requires a permission that app registration client does not have
- Observe the thrown exception as shown above
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere den Fehler mit Client-Secret-Anmeldedaten und einem API-Aufruf, bei dem die erforderliche Berechtigung fehlt. Beginne anhand des Stacktraces mit ODataError.createFromDiscriminatorValue, JsonParseNode.getObjectValue und OkHttpRequestAdapter.throwIfFailedResponse; abgeschlossen ist die Untersuchung, wenn die Antwort auf den Berechtigungsfehler ohne die Parsing-Ausnahme in einen nutzbaren Fehler deserialisiert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- api, authorization
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100