feat(ruby): add support for deep object query parameters #11767
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.
Description
Refs: https://app.devin.ai/sessions/64b3914c128f4cfa957eaab189b9c426
Requested by: @iamnamananand996
Adds support for deep object query parameters to the Ruby SDK generator, following the same pattern as the PHP implementation. Nested objects are now encoded using bracket notation (e.g.,
filter[name]=john&filter[age]=30).Changes Made
QueryParamsUtilityclass that generates a Ruby utility withflatten_query_paramsmethodEndpointGeneratorto wrap query parameters with the flatten call before passing to FaradayAbstractionUtilitiesandClientsGeneratorto thread the utility through the generation pipelineThe generated Ruby utility handles:
{filter: {name: "john"}}→filter[name]=john{filter: {user: {name: "john"}}}→filter[user][name]=john{tags: ["a", "b"]}→tags=a&tags=b{objects: [{key: "val"}]}→objects[key]=valTesting
Human Review Checklist
QueryParamsUtility.ts(lines 42-62) are syntactically correct Ruby{ |_k, old, new_val| [*old, *new_val].flatten }handles edge cases correctlygenerateEndpointscall sites have been updated with the newqueryParamsUtilityparameter