microsoftgraph / microsoftgraph/msgraph-sdk-java

"java.lang.IllegalArgumentException: Collection is empty" when calling `lastEstimateStatisticsOperation`

未关闭
#2,656 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

status:waiting-for-triage type:bug
主要语言
Java
星标
444
派生
154
平均合并
18 小时 28 分钟
30 天内合并 PR
4

描述

Describe the bug

I'm fetching Search estimate statistics in Purview using the following call:

EdiscoveryEstimateOperation estimateOperation = client.security()
                .cases()
                .ediscoveryCases()
                .byEdiscoveryCaseId(caseId)
                .searches()
                .byEdiscoverySearchId(searchId)
                .lastEstimateStatisticsOperation()
                .get();

This consistently fails with the following error:

java.lang.IllegalArgumentException: Collection is empty
    at java.base/java.util.EnumSet.copyOf(EnumSet.java:177)
    at com.microsoft.kiota.serialization.JsonParseNode.getEnumSetValue(JsonParseNode.java:257)
    at com.microsoft.graph.beta.models.security.EdiscoveryEstimateOperation.lambda$getFieldDeserializers$6(EdiscoveryEstimateOperation.java:41)
    at com.microsoft.kiota.serialization.JsonParseNode.assignFieldValues(JsonParseNode.java:280)
    at com.microsoft.kiota.serialization.JsonParseNode.getObjectValue(JsonParseNode.java:192)
    at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:322)
    at com.microsoft.graph.beta.security.cases.ediscoverycases.item.searches.item.lastestimatestatisticsoperation.LastEstimateStatisticsOperationRequestBuilder.get(LastEstimateStatisticsOperationRequestBuilder.java:61)
    at com.microsoft.graph.beta.security.cases.ediscoverycases.item.searches.item.lastestimatestatisticsoperation.LastEstimateStatisticsOperationRequestBuilder.get(LastEstimateStatisticsOperationRequestBuilder.java:47)

It seems like response deserialization isn't working correctly, probably for the statisticsOptions field? It might be relevant that there doesn't seem to be any way to specify statisticsOptions when triggering statistics generation through the API.

Expected behavior

I expect this SDK call to successfully return an EdiscoveryEstimateOperation for the given search.

How to reproduce

I'm starting statistics generation with the following call:

client.security()
                .cases()
                .ediscoveryCases()
                .byEdiscoveryCaseId(caseId)
                .searches()
                .byEdiscoverySearchId(searchId)
                .microsoftGraphSecurityEstimateStatistics()
                .post();

Fetching statistics with the call listed above then triggers the bug.

SDK Version

beta 6.61.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 EdiscoveryEstimateOperation.java:41 中生成的 EdiscoveryEstimateOperation 反序列化器开始,跟踪 JsonParseNode.getEnumSetValue,并使用报告的 lastEstimateStatisticsOperation request 进行复现。将 statisticsOptions 的响应处理与 API response 进行比较;如果 repository 提供了相关测试,则添加或更新一个针对性的反序列化测试。完成的标准是调用返回 EdiscoveryEstimateOperation,且不会出现空集合异常。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
api
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。