Deserialization Error in RouteMatrixResultResponse When Error String is Returned Instead of Null #45643
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Maps
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
Workflow: This issue is responsible by Azure service team.
Library name and version
Azure Maps Routing API Version: 1.0
Describe the bug
When submitting a Post Route Matrix Request I encountered a deserialization issue with the RouteMatrixResult API when a distance to one of the destinations cannot be resolved. Specifically, the API returns a serialized RouteMatrixResult containing an array of RouteMatrixes. Each RouteMatrix holds a RouteMatrixResultResponse, which in turn contains a RouteLegSummary.
However, when the distance to a destination cannot be resolved, the response field in the RouteMatrixResultResponse is returned as an error string instead of a null value for the RouteMatrixResultResponse object. This causes a deserialization error on the client side, which currently requires manual handling.
Example json:
n the example above, the first entry in the matrix array returns an error string under the response field, which causes a deserialization failure on the client side.
Expected behavior
The response field should return a null value or an appropriately structured error object instead of a plain error string when a distance cannot be resolved. This would prevent deserialization errors and allow the client to handle errors more gracefully.
Actual behavior
Deserialization fails
Reproduction Steps
Steps to Reproduce:
Environment
.NET6, VS Version 17.10.5
The text was updated successfully, but these errors were encountered: