Skip to content

Conversation

@iamnamananand996
Copy link
Member

@iamnamananand996 iamnamananand996 commented Jan 26, 2026

Description

Refs: Requested by @iamnamananand996

Adds support for deep object query parameters in the PHP SDK generator. Nested objects in query parameters are now encoded using bracket notation (e.g., filter[user][name]=john&filter[user][age]=30), matching the OpenAPI 3.0 deepObject serialization style.

This brings PHP in line with Python, Java, and C# generators which already support this feature.

Link to Devin run: https://app.devin.ai/sessions/64b3914c128f4cfa957eaab189b9c426

Changes Made

  • Added flattenQueryParams() method to RawClient.Template.php that recursively flattens nested arrays into query parameter format with bracket notation
  • Modified encodeQuery() to use the new flattening method
  • Added 3 unit tests covering:
    • Simple deep object query parameters (filter[name]=john)
    • Deeply nested objects (filter[user][name]=john)
    • Arrays of objects (objects[key]=hello&objects[value]=world)
  • Updated versions.yml with version 1.26.0 changelog entry
  • Updated README.md generator (if applicable) - N/A

Testing

  • Unit tests added/updated
  • Manual testing completed (verified with mock server that encoding produces correct OpenAPI deepObject format)

Updates Since Last Revision

  • Merged main branch to resolve merge conflict in versions.yml (incorporated v1.25.4 fix for wire tests)

Human Review Checklist

  • Verify flattenQueryParams correctly distinguishes between associative arrays (objects) and sequential arrays (lists) using isSequential()
  • Confirm empty array handling is correct (empty arrays treated as sequential, resulting in no query params)
  • Verify test assertions match expected OpenAPI deepObject serialization format (brackets URL-encoded as %5B and %5D)

Co-Authored-By: naman.anand@buildwithfern.com <iamnamananand996@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: naman.anand@buildwithfern.com <iamnamananand996@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants