msgraph-sdk-java
msgraph-sdk-java copied to clipboard
Specified range is not being pull in worksheet in graph api.
Expected behavior
API /me/drive/items/{id}/workbook/worksheets/{id|name}/range(address='
') should give range for given address.Actual behavior
API /me/drive/items/{id}/workbook/worksheets/{id|name}/range(address='
') giving full range of worksheet.Steps to reproduce the behavior
execute API: /me/drive/items/{id}/workbook/worksheets/{id|name}/range(address='
') with proper input in java sdk.
https://github.com/microsoftgraph/msgraph-sdk-java/pull/1062
Hello, we are facing the same issue. Namely, that the "GetRange" endpoint doesn't respect the given address/range.
The endpoint works normally when used in Graph Explorer or with plain HTTP requests in Java, but when we use the GraphAPI-Java-SDK in the same way, it doesn't work. Or to be more precise, it does the same action as if a blank string "" was entered for the address of the range.
Also, we can confirm that there exists a bug in the original GraphAPI-Java-SDK code for which @BaranwalG submitted a fix. Namely, without his fix it misses to actually use the address field of the range and that's why each GetRange request has the same response as if one didn't enter any address for it. To be more concrete, without his fix the address, which is stored in the "functionOptions" field, never gets added to the actual HTTP request. The relevant code in question: https://github.com/microsoftgraph/msgraph-sdk-java/blob/d3beed71c8502e86826b7f11cbce95c06506c4d4/src/main/java/com/microsoft/graph/requests/WorkbookWorksheetRangeRequestBuilder.java#L43-L74
Java code which can be used to see that providing an address for the GetRange endpoint doesn't do anything in the GraphAPI-Java-SDK, i.e. the address gets ignored:
var valueOfA1 = _graphApiClient
.drives(DRIVE_ID)
.items(ITEM_ID)
.workbook()
.worksheets("Sheet1")
.range(WorkbookWorksheetRangeParameterSet.newBuilder()
.withAddress("A1")
.build())
.buildRequest()
.get();
LOGGER.info("Address should be 'Sheet1!A1', but is actually:\n{}\n", valueOfA1.address);
But the same request as a plain HTTP request works, i.e. returns the desired range and has the correct address:
GET https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{item-id}/workbook/worksheets/Sheet1/range(address='A1')
Hope you can help us with this.
@baywet any update on this!
Is there any news on this topic? We are also missing the row and the column function for ranges.
Hi @BaranwalG, @JimeFuture, and @jkscx, what I had originally thought was an error in our Java-Core library turned out to be an issue with the way we generate our method RequestBuilders. This resulted in a low prioritization issue since we are currently working on our newest versions of our SDK. I am putting a PR together to address this issue across all classes which may be missing the lines noted by @BaranwalG. In the meantime, I encourage you all to try out our Kiota-Built libraries, ie SDK version 6.0.0-snapshot, as they may be more reliable for these generation scenarios. I apologize for the delay and thank you all for your input. There may be about a week-long turn around before we see these generation changes implemented into our current v1 and beta libraries as our generation pipeline is run weekly on Tuesdays.