microsoftgraph / microsoftgraph/msgraph-beta-sdk-java
Permissions error response not deserialized correctly
未关闭
还没有人认领这个 Issue。
Needs: attention :wave:
question
- 主要语言
- Java
- 星标
- 32
- 派生
- 14
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 6
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用 client-secret 凭据以及缺少所需权限的 API 调用重现该故障。从堆栈跟踪中的 ODataError.createFromDiscriminatorValue、JsonParseNode.getObjectValue 和 OkHttpRequestAdapter.throwIfFailedResponse 开始;当权限错误响应能够在不触发解析异常的情况下反序列化为可用的错误时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- api, authorization
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100