msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

Bookings throws Exception when parsing Booking Services without physical address (geographic coordinates)

Open adouglass opened this issue 1 year ago • 0 comments

Describe the bug Exception: The requested operation requires an element of type 'Number', but the target element has type 'String'. It appears that the SDK is attempting to parse the Booking Business' services default Location geographic coordinates as a double, but the Graph API will sometimes return them as NaN.

Microsoft Graph API v1.0 Customer booking: bookingService SDK version 5.0.0.preview-11 .NET 6.0

To Reproduce

  1. Create a Microsoft Bookings calendar and add a service without specifying a physical address/location (e.g. a virtual service to be provided via Teams)
  2. Use the Graph SDK to fetch the Services for the BookingBusiness
  3. Experience JSON parse exception
  4. Verify you can pull the information using Postman/REST API and with 4.x SDK

Expected behavior The 4.x SDK was able return the list of Booking Business' Services without error.

Screenshots The REST API for this query (/v1.0/solutions/bookingBusiness/{business}/services) returns geographic coordinates of NaN image

Additional context The requested operation requires an element of type 'Number', but the target element has type 'String'. Stack Trace at System.Text.Json.JsonDocument.TryGetValue(Int32 index, Double& value) at System.Text.Json.JsonElement.GetDouble() at Microsoft.Kiota.Serialization.Json.JsonParseNode.GetDoubleValue() at Microsoft.Graph.Models.OutlookGeoCoordinates.<GetFieldDeserializers>b__27_1(IParseNode n) at Microsoft.Kiota.Serialization.Json.JsonParseNode.AssignFieldValues[T](T item, IDictionary2 fieldDeserializers) at Microsoft.Kiota.Serialization.Json.JsonParseNode.GetObjectValue[T](ParsableFactory1 factory) at Microsoft.Graph.Models.Location.<GetFieldDeserializers>b__36_1(IParseNode n) at Microsoft.Kiota.Serialization.Json.JsonParseNode.AssignFieldValues[T](T item, IDictionary2 fieldDeserializers) at Microsoft.Kiota.Serialization.Json.JsonParseNode.GetObjectValue[T](ParsableFactory1 factory) at Microsoft.Graph.Models.BookingService.<GetFieldDeserializers>b__59_3(IParseNode n) at Microsoft.Kiota.Serialization.Json.JsonParseNode.AssignFieldValues[T](T item, IDictionary2 fieldDeserializers) at Microsoft.Kiota.Serialization.Json.JsonParseNode.GetObjectValue[T](ParsableFactory1 factory) at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.<SendAsync>d__141.MoveNext() at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.<SendAsync>d__141.MoveNext() at Microsoft.Graph.Solutions.BookingBusinesses.Item.Services.Item.BookingServiceItemRequestBuilder.<GetAsync>d__18.MoveNext()

adouglass avatar Sep 19 '22 19:09 adouglass