Open
Description
Library name and version
Azure.Analytics.Synapse.Artifacts 1.0.0-preview.18
Describe the bug
The SessionId property is mapped as int64 but the API is returning it as string.
Expected behavior
The property type matches the API response, and the deserialization works.
Actual behavior
An exception is raised.
System.InvalidOperationException: 'The requested operation requires an element of type 'Number', but the target element has type 'String'.'
Reproduction Steps
var r = await notebookRunClient.GetSnapshotAsync("7942e5c5-e9f1-42b6-88cd-c59a6afa2f4a");
var r2 = await notebookRunClient.GetStatusAsync("7942e5c5-e9f1-42b6-88cd-c59a6afa2f4a");
I created a custom HttpPipelinePolicy to workaround the problem:
public override async ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory<HttpPipelinePolicy> pipeline)
{
await ProcessNextAsync(message, pipeline);
var json = await JsonSerializer.DeserializeAsync<JsonObject>(using message.Response.ContentStream);
json["result"]["sessionId"] = long.Parse(json["result"]["sessionId"].GetValue<string>());
var memoryStream = new MemoryStream();
await JsonSerializer.SerializeAsync(memoryStream, json);
memoryStream.Position = 0;
message.Response.ContentStream = memoryStream;
}
Environment
No response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
This issue points to a problem in the data-plane of the library.Workflow: This issue is responsible by Azure service team.Issues that are reported by GitHub users external to the Azure organization.Workflow: This issue needs attention from Azure service team or SDK teamThe issue doesn't require a change to the product in order to be resolved. Most issues start as that