Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseRequestConfiguration#options field is set to an immutable list #1238

Closed
m-moris opened this issue Apr 25, 2024 · 1 comment · Fixed by #1240
Closed

BaseRequestConfiguration#options field is set to an immutable list #1238

m-moris opened this issue Apr 25, 2024 · 1 comment · Fixed by #1240
Assignees
Labels
bug Something isn't working
Milestone

Comments

@m-moris
Copy link
Contributor

m-moris commented Apr 25, 2024

I encountered the following error while using Graph SDK for Java. Upon investigating the cause, I found that an immutable object from Collections.emptyList() was assigned to com.microsoft.kiota.BaseRequestConfiguration#options

Is it possible to change this initial value to a mutable list? Is there any specific reason why an immutable list is being actively used?

public abstract class BaseRequestConfiguration {
/**
* Default constructor
*/
public BaseRequestConfiguration() {
// default empty constructor
}
/**
* Request headers
*/
@Nonnull public RequestHeaders headers = new RequestHeaders();
/**
* Request options
*/
@Nonnull public List<RequestOption> options = Collections.emptyList();
}

@baywet
Copy link
Member

baywet commented Apr 25, 2024

Thanks for creating a related issue!
The fix seems pretty straight forward here, we should assign a new array list instead of using that static method.
Would you be willing to submit a pull request for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
2 participants