Permissions error response not deserialized correctly

Đang mở
#918 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
api, authorization

Hướng nghiên cứu

Tái hiện lỗi với thông tin xác thực client-secret và một lệnh gọi API thiếu quyền bắt buộc. Bắt đầu với ODataError.createFromDiscriminatorValue, JsonParseNode.getObjectValue và OkHttpRequestAdapter.throwIfFailedResponse từ stack trace; hoàn tất khi phản hồi lỗi quyền được deserialize thành một lỗi có thể sử dụng mà không phát sinh parsing exception.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Needs: attention :wave: question
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
Ngôn ngữ chính
Java
Star
32
Fork
14
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
6

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoftgraph/msgraph-beta-sdk-java

Tất cả issue của microsoftgraph/msgraph-beta-sdk-java

Issue tương tự

Thêm issue về Java

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.