You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

msgraph-sdk-java BookingService接口返回NaN引发NumberFormatException问题

问题详情

预期行为

调用以下Graph API端点:

GET /v1.0/solutions/bookingBusinesses/{bookingBusiness-id}/services/{bookingService-id}

预期能获取对应bookingBusiness的服务数据,返回格式为BookingService对象或列表。

实际行为

调用该端点时抛出异常:

java.lang.NumberFormatException: JSON forbids NaN and infinities: NaN

经排查,API返回的服务数据中,defaultLocation.coordinates对象的所有字段值均为NaN;而使用委托身份验证时,这些坐标字段返回值为null。

API返回的示例数据片段:

"defaultLocation": {
  "displayName": "",
  "locationEmailAddress": "",
  "locationUri": "",
  "locationType": "default",
  "uniqueId": null,
  "uniqueIdType": null,
  "address": {
    "street": "",
    "city": "",
    "state": "",
    "countryOrRegion": "",
    "postalCode": ""
  },
  "coordinates": {
    "altitude": "NaN",
    "latitude": "NaN",
    "longitude": "NaN",
    "accuracy": "NaN",
    "altitudeAccuracy": "NaN"
  }
}

使用的依赖版本:maven仓库中的msgraph 5.46.0。

已尝试的解决步骤:

  • 在服务GUI中寻找移除coordinates对象的选项,未找到相关设置;
  • 尝试通过API将服务的坐标字段更新为null或数值类型,但SDK调用后返回结果仍为NaN。

内容的提问来源于stack exchange,提问作者benoit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 14:45:58