-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Description
Expected behavior
Specifying a select query option when creating a folder will successfully return the select properties as part of the response.
Actual behavior
An exception is thrown with a 400 "Bad Request" response code. Looking at a more detailed message shows the following:
Query option '$select' was specified more than once, but it must be specified at most once.
It looks like the Java SDK duplicates the select query options upon building the request. This can be seen when looking at the request URL sent:
https://graph.microsoft.com/v1.0/drives/randomDriveId/items/root/children?$select=id&$select=id
Steps to reproduce the behavior
DriveItemWithInstanceAttributes folderToCreate = DriveItemWithInstanceAttributes.builder()
.withName(folderName)
.withFolder(new Folder())
.withConflictBehavior("fail")
.build();
DriveItem createdFolder = graphClient.drives(driveId).items(parentItemId).children().buildRequest().select("id").post(folderToCreate)
This successfully runs if select options are excluded from request.