Skip to content

GRAM-4868: fix stale array-param test calls for v2 ids parameter - #313

Merged
dmitriyeff merged 1 commit into
masterfrom
gram-4868-fix-array-param-tests
Sep 18, 2026
Merged

dmitriyeff merged 1 commit into
masterfrom
gram-4868-fix-array-param-tests

Conversation

@dmitriyeff

Copy link
Copy Markdown
Contributor

Summary

  • api-docs commit 6515fe5 (GRAM-4868) changed the v2 ids/include_fields/custom_fields query parameters from type: string to type: array (style: form, explode: false), which is the correct OpenAPI shape (matches the existing deal_ids pattern) and produces the same comma-separated wire format.
  • This changed the generated PHP SDK's $ids parameter type from string to string[]. ActivitiesApiTest::it lists activities and DealsApiTest::it lists deals were still passing a comma-joined string ('1,2,3'), which throws TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given against the regenerated SDK (ActivitiesApi::getActivitiesRequest, DealsApi::getDealsRequest do count($ids) > 100).
  • This is what's failing "Run Functional Tests" in api-docs's "Post Deploy To Live" workflow, e.g. run 35215618700.

Fix

Pass arrays instead of comma-joined strings for ids, matching the new generated signature. Expected query string assertions are unchanged since ObjectSerializer::serializeCollection($ids, 'form', true) still joins with a comma on the wire.

Test plan

  • Ran vendor/bin/pest locally against this branch (PHP 8.3): 19 passed, 12 skipped, 0 failed (previously 2 failed with the reported TypeError).

getActivities()/getDeals() now type $ids as string[] (array, style
form, explode false) following the api-docs schema change from
type: string to type: array. Update the two v2 test calls that were
still passing a comma-joined string, which throws a TypeError in
count($ids) with the regenerated SDK.
Copilot AI lite review requested due to automatic review settings September 18, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are narrowly scoped test updates that correctly align with the regenerated v2 SDK parameter types while preserving the expected query serialization.

Pull request overview

Updates the v2 functional tests to match the regenerated PHP SDK method signatures after the OpenAPI ids query parameter was corrected from string to array (comma-separated on the wire), preventing runtime TypeError failures in request-building code that uses count($ids).

Changes:

  • Update DealsApiTest to pass ids as an array (['1', '2']) instead of a comma-joined string.
  • Update ActivitiesApiTest to pass ids as an array (['1', '2', '3']) instead of a comma-joined string.
  • Keep query-string assertions unchanged (wire format remains comma-separated via collection serialization).
File summaries
File Description
test/versions/v2/Deals/DealsApiTest.php Pass ids as an array to match the v2 SDK signature and avoid count() on string.
test/versions/v2/Activities/ActivitiesApiTest.php Pass ids as an array to match the v2 SDK signature and avoid count() on string.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dmitriyeff
dmitriyeff merged commit 564df06 into master Sep 18, 2026
1 check passed
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.

3 participants