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

feat: add support for keeping boolean values "as is" in query #603

Open
wants to merge 1 commit into
base: 2.6
Choose a base branch
from

Conversation

simPod
Copy link

@simPod simPod commented Apr 27, 2024

I've stumbled upon this for like milion times now.

This is a follow up of #391

Currently, there's no way not to cast boolean values to int in a query. http_build_query() casts booleans to ints, however, that is not always the wanted behaviour when constructing a query to call some API.

E.g. Swagger sends =true =false for params of type boolean. There are APIs that require this value format (e.g. https://github.com/PowerDNS/pdns).

This has been discussed many times over and over and the conclusion I make of it is that the behaviour should be configurable since it depends on the target API (e.g. see OpenAPITools/openapi-generator#2204).

Therefore, I propose a flag that allows switch the behaviour in Query::build(). It should be BC compatible with the default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant