microsoftgraph / msgraph-sdk-java

Microsoft Graph SDK for Java
https://docs.microsoft.com/en-us/graph/sdks/sdks-overview
MIT License
369 stars 126 forks source link

WorkbookRange not properly deserialized, does not contain JSON arrays #1880

Open DHerls opened 4 months ago

DHerls commented 4 months ago

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

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: image

But the WorkbookRange object does not contain any of the values data: image

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));
youngcho79 commented 4 months ago

@baywet - can we have someone take a look at this issue? thanks.

vanloc087 commented 4 months ago

@baywet

baywet commented 4 months ago

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.

baywet commented 4 months ago

Related https://github.com/microsoftgraph/msgraph-metadata/issues/596