WorkbookRange not properly deserialized, does not contain JSON arrays
Expected behavior
When calling the Get range method using the Microsoft Graph Java SDK, the getValues() method of the WorkbookRange object should return the data from the values parameter in the response.
This also applies to
- formulas
- formulasLocal
- numberFormat
- text
- valueTypes
Actual behavior
The getValues() method returns an empty JSON node that does not include any of the Worksheet data. We can see from the debugger that the values are returned from the API when making the request, but the Values JSON node is completely empty when returned.
The API clearly returns the correct data:
But the WorkbookRange object does not contain any of the values data:
Steps to reproduce the behavior
Using the following versions:
com.microsoft.graph:microsoft-graph = 6.4.0
com.microsoft.kiota:microsoft-kiota-serialization-json = 1.0.6
// Initialize graph client
WorkbookRange range = graphClient
.drives()
.byDriveId(driveId)
.items()
.byDriveItemId(itemId)
.workbook()
.rangeWithAddress(address)
.get()
SerializationWriter writer = new JsonSerializationWriter();
range.getValues().serialize(writer);
// This prints an empty string
System.out.println(new String(writer.getSerializedContent().readAllBytes(), StandardCharsets.UTF_8));
@baywet - can we have someone take a look at this issue? thanks.
@baywet
- Any method of Workbook Range that has a return type of Json will get the same error. Looking forward to your support
Hey everyone, Thank you for your patience on the matter. The first step towards fixing this has been implemented with this pull request and the associated ones in other languages. https://github.com/microsoft/kiota-abstractions-dotnet/pull/177
We now need to update the metadata so it does use graph JSON anymore (a legacy construct) but OData unknown instead.
After that we might need to update the conversion library so it maps OData unknown to OpenAPI any.
Related https://github.com/microsoftgraph/msgraph-metadata/issues/596