Skip to content

Creating a folder does not properly handle the select query option #336

@BillCollabAuth

Description

@BillCollabAuth

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions