msgraph-sdk-dotnet
msgraph-sdk-dotnet copied to clipboard
Bookings throws Exception when parsing Booking Services without physical address (geographic coordinates)
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
- 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)
- Use the Graph SDK to fetch the Services for the BookingBusiness
- Experience JSON parse exception
- 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
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](ParsableFactory
1 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](ParsableFactory
1 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](ParsableFactory
1 factory)
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.<SendAsync>d__141.MoveNext() at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.<SendAsync>d__14
1.MoveNext()
at Microsoft.Graph.Solutions.BookingBusinesses.Item.Services.Item.BookingServiceItemRequestBuilder.<GetAsync>d__18.MoveNext()