Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialization Error in RouteMatrixResultResponse When Error String is Returned Instead of Null #45643

Closed
ChristopherErbs opened this issue Aug 22, 2024 · 3 comments
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.

Comments

@ChristopherErbs
Copy link

ChristopherErbs commented Aug 22, 2024

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:

{
	"formatVersion": "0.0.1",
	"matrix": [
		[
			{
				"statusCode": 400,
				"response": "Engine error while executing route request: MAP_MATCHING_FAILURE: Destination (1, 13.5471)",
				"detailedError": {
					"message": "Engine error while executing route request: MAP_MATCHING_FAILURE: Destination (1, 13.5471)",
					"code": "MAP_MATCHING_FAILURE"
				}
			},
			{
				"statusCode": 200,
				"response": {
					"routeSummary": {
						"lengthInMeters": 264939,
						"travelTimeInSeconds": 10394,
						"trafficDelayInSeconds": 191,
						"trafficLengthInMeters": 16648,
						"departureTime": "2024-08-21T09:31:41+02:00",
						"arrivalTime": "2024-08-21T12:24:55+02:00"
					}
				}
			},
			{
				"statusCode": 200,
				"response": {
					"routeSummary": {
						"lengthInMeters": 305985,
						"travelTimeInSeconds": 11207,
						"trafficDelayInSeconds": 191,
						"trafficLengthInMeters": 16648,
						"departureTime": "2024-08-21T09:31:41+02:00",
						"arrivalTime": "2024-08-21T12:38:28+02:00"
					}
				}
			}
		]
	]
}

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:

  1. Make a request to the RouteMatrix API with a destination that cannot be resolved.
  2. Observe the response field in the RouteMatrixResultResponse for the destination.
  3. Attempt to deserialize the response into the expected object model.

Environment

.NET6, VS Version 17.10.5

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Aug 22, 2024
@jsquire jsquire added Service Attention Workflow: This issue is responsible by Azure service team. Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Maps and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Aug 22, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dubiety @jecmenicanikola.

@dubiety
Copy link
Member

dubiety commented Sep 13, 2024

@ChristopherErbs , thank you for reporting this issue. We'll take a look and try to fix the problem soon!

This was referenced Oct 16, 2024
@dubiety
Copy link
Member

dubiety commented Dec 10, 2024

Hi @ChristopherErbs ,

We've released Azure.Maps.Routing package v1.0.0-beta.4 to fix this problem. Please try again and welcome to reopen the issue if you still encounter any problem. Thank you for your patience!

@dubiety dubiety closed this as completed Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

3 participants