fix: serialize query params with the documented encoding - #57
Merged
Merged
Conversation
javorosas
requested review from
raul-facturapi
and
a lite review from Copilot
September 10, 2026 16:28
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The functional changes are well-covered by tests and align with the stated API encoding, with only a minor release-note spelling nit identified.
Pull request overview
Updates BaseClient::arrayToParams() to serialize query parameters using the encoding documented by the API (and used by other official SDKs), ensuring consistent URLs for equivalent searches across SDKs.
Changes:
- Refactors query parameter serialization to repeat keys for list values, keep bracket notation for associative arrays, and omit
nullvalues. - Adds PHPUnit coverage for list repetition,
nullomission, and explicit empty-string handling. - Records the fix under the pending
4.8.0entry inVERSION.md.
File summaries
| File | Description |
|---|---|
src/Http/BaseClient.php |
Implements the updated query parameter encoding via a dedicated helper. |
tests/Resources/InvoicesTest.php |
Adds regression tests for list, null, and empty-string query parameter behavior. |
VERSION.md |
Documents the serialization change in the pending release notes. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
raul-facturapi
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
BaseClient::arrayToParams()now emits the query encoding the API documents and the other official SDKs send:status=valid&status=canceled(wasstatus[0]=valid&status[1]=canceled).nullvalues are omitted instead of being sent empty (q=). Passing an empty string still sends an explicit empty value (q=).date[gte]=...&date[lte]=...) and booleans keeptrue/false.This aligns the encoding with the
deepObjectstyle documented for nested filters and the defaultform+explodestyle for arrays, and with the other SDKs, so the same search sends the same URL everywhere.Tests
New cases cover a list value, a
nullvalue, and an explicit empty string.Release note
VERSION.mdrecords the fix under the pending4.8.0entry.