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

[BUG] Breaking Change: Boolean true Converted to 1, Causing Illegal Argument Exception #246

Open
dmnlk opened this issue Jan 8, 2025 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@dmnlk
Copy link

dmnlk commented Jan 8, 2025

What is the bug?

I have been testing and validating the implementation of the following PR in my project.
I am using GuzzleHttp as the client, but I noticed one breaking change.

When passing true as a request parameter (e.g., for the refresh option in an index operation), it gets converted into 1 during the request, which results in an illegal_argument_exception.
The detailed error message is:
Failed to parse value [1] as only [true] or [false] are allowed.

While options like refresh can be passed as strings (since they seem to be enums), options like require_alias are booleans, which makes this change problematic.

I believe this behavior should be corrected.

How can one reproduce the bug?

specify require_alias is true

What is the expected behavior?

collectry passing true

What is your host/environment?

mac os

Do you have any screenshots?

no

Do you have any additional context?

no

@dmnlk dmnlk added bug Something isn't working untriaged labels Jan 8, 2025
@dblock
Copy link
Member

dblock commented Jan 8, 2025

This is from #233 right? Want to help fix?

@dblock dblock removed the untriaged label Jan 8, 2025
@kimpepper kimpepper added the question Further information is requested label Jan 23, 2025
@kimpepper
Copy link
Collaborator

@dmnlk can you provide the version of opensearch-php you are using, and whether you are using the ClientBuilder to create the client?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants