msgraph-sdk-java icon indicating copy to clipboard operation
msgraph-sdk-java copied to clipboard

WorkbookRange not properly deserialized, does not contain JSON arrays

Open DHerls opened this issue 1 year ago • 4 comments

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: 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));

DHerls avatar Mar 08 '24 17:03 DHerls

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

youngcho79 avatar Mar 25 '24 18:03 youngcho79

@baywet

  • Any method of Workbook Range that has a return type of Json will get the same error. Looking forward to your support

vanloc087 avatar Mar 29 '24 07:03 vanloc087

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 avatar Mar 29 '24 20:03 baywet

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

baywet avatar Mar 29 '24 20:03 baywet