fix(typescript): resolve query parameter name conflicts stripping body properties#14238
Merged
tstanmay13 merged 3 commits intomainfrom Mar 30, 2026
Merged
Conversation
…colliding query params When resolveQueryParameterNameConflicts is enabled and a query parameter name collides with a body property name, getNonBodyKeys and getNonBodyKeysWithData now use the overridden property name (e.g. filterIsComplete) instead of the wire value (e.g. is_complete). Previously, the destructuring pattern would extract the body property by its wire name, causing it to be stripped from the spread into _body. This resulted in empty request bodies being sent for endpoints with colliding query param and body property names. Co-Authored-By: jon <jon@buildwithfern.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
…ct-body-stripping Co-Authored-By: jon <jon@buildwithfern.com>
…ct-body-stripping Co-Authored-By: jon <jon@buildwithfern.com>
tstanmay13
approved these changes
Mar 30, 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.
Description
Refs https://github.com/fern-demo/close-typescript-sdk/pull/5
Fixes a bug where request body properties were silently stripped from generated SDK client methods when
resolveQueryParameterNameConflictsis enabled and query parameter wire names collide with body property names.Root Cause
getNonBodyKeysandgetNonBodyKeysWithDatainGeneratedRequestWrapperImpl.tsalways calledgetPropertyNameOfQueryParameter, which returns{ propertyName: wireValue, safeName }. For colliding query params, this produced a destructuring pattern like:This extracts the body properties
assigned_toandis_complete(by their wire names), removing them from the..._bodyspread — so the request body is sent as{}.Fix
Both methods now check
getCollidingQueryParamWireValues(only whenresolveQueryParameterNameConflictsis enabled) and usegetOverriddenPropertyNameOfQueryParameterfor colliding params, which returns{ propertyName: overriddenName, safeName }. This produces:Body properties like
is_completeare no longer extracted and remain in_body.Changes Made
getNonBodyKeysandgetNonBodyKeysWithDatato use overridden property names for colliding query parametersgenerators/typescript/sdk/versions.ymlTesting
request-wrapper-generatorpassclient-class-generatorpassassigned_to: filterAssignedTo) and the fixed code generates correct destructuring (filterAssignedTo) by regenerating thequery-param-name-conflictseed fixture both with and without the fixReview Checklist
withQueryParameter/getReferenceToQueryParameterinRequestWrapperParameter.tsstill resolve aliases correctly — bothgetPropertyNameOfQueryParameterandgetOverriddenPropertyNameOfQueryParametershare the samesafeName, so alias lookup should be unaffected, but worth confirminggetCollidingQueryParamWireValuesis only called whenresolveQueryParameterNameConflictsistrue(gated at lines 519 and 546)getCollidingQueryParamWireValuesis now called twice per endpoint (once in each method) — this is harmless for small query param lists but worth notingLink to Devin session: https://app.devin.ai/sessions/d27799c513934481a4042a6818cffd00
Requested by: @jon-fern