Skip to content

fix: flatten search params to PHP bracket notation#2

Merged
giovanny07 merged 1 commit into
mainfrom
fix/search-param-encoding
Jun 22, 2026
Merged

fix: flatten search params to PHP bracket notation#2
giovanny07 merged 1 commit into
mainfrom
fix/search-param-encoding

Conversation

@giovanny07

Copy link
Copy Markdown
Owner

Summary

  • Add _flatten_search_params() helper that converts criteria, metacriteria, and forcedisplay from Python lists/dicts into PHP-style bracket notation (criteria[0][field]=126)
  • Applied in both GlpiAPI.search() (sync) and AsyncGlpiAPI.search() (async)
  • 10 new tests covering unit + integration scenarios

Fixes #1

Test plan

  • Unit tests for _flatten_search_params: single/multiple criteria, metacriteria, forcedisplay, combined, empty, passthrough
  • Integration tests verifying search() and proxy .search() send flattened params to the HTTP client
  • Full existing test suite passes with no regressions

@giovanny07 giovanny07 merged commit f734e2c into main Jun 22, 2026
5 checks passed
@giovanny07 giovanny07 self-assigned this Jun 22, 2026
@giovanny07 giovanny07 added the bug Something isn't working label Jun 22, 2026
@giovanny07 giovanny07 deleted the fix/search-param-encoding branch June 22, 2026 16:22
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

None yet

Development

Successfully merging this pull request may close these issues.

Search endpoint does not correctly encode criteria/metacriteria query parameters

1 participant