UliPlabst's avatar
UliPlabst
Regular Visitor
5 years ago
Status:
New

Deserialization Bug in PowerBI-CSharp Library GetModifiedWorkspacesAsync

I'm trying to use the Library https://github.com/microsoft/PowerBI-CSharp to access the Power BI Rest Api from my C# application. I'm posting here because Github issue tracking is disabled in the repo.

When using the new Api

 

PowerBIClient.WorkspaceInfo.GetModifiedWorkspacesAsync

 

an Exception is thrown:

Microsoft.Rest.SerializationException: 'Unable to deserialize the response.'

I checked the code and it seems the response body is deserialized to type ModifiedWorkspaces although the returned JSON is an array of objects containing a single Id property. There is no custom Json Converter registered to handle this deserialization and therefore the exception is thrown. When looking at the type ModifiedWorkspaces it's just a wrapper type around the array of type ModifiedWorkspace but it also contains an OdataContext property which is not returned from the api. 

So maybe it should be sorted out what the returned data should actually look like and then either change the Api or the Client library to reflect that.