fix(typescript): deduplicate request wrapper properties when path parameter conflicts with body property #11086
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/uipath-typescript/commit/58c5f83f0f5b076cd9c4b65072d74f200185e6ed
Fixes a bug where the TypeScript SDK generator produced duplicate properties in request wrapper interfaces when a path parameter had the same name as a body property. This caused TypeScript compilation errors due to duplicate property declarations.
Link to Devin run: https://app.devin.ai/sessions/a779b6fce51e491e9d8a4d1f6d819ca3
Requested by: [email protected] (@tjb9dc)
Changes Made
getRequestProperties()inGeneratedRequestWrapperImpl.tsto collect body properties first, then skip path/query/header parameters that conflict with body property namespath-body-property-collisionto validate the fix and prevent regressionspath-body-property-collisionto ruby-sdkallowedFailures(ruby generator has IR compatibility issues with this fixture)Testing
path-body-property-collision)ToggleRequestinterface has singlekeyproperty (not duplicate)Client.tscorrectly useskeyfor both path substitution and bodypnpm run check)CI Status
Some CI checks are failing with errors that appear unrelated to this PR:
Unexpected end of file in source maperror inpackages/ir-sdk/lib/sdk/serialization/resources/http/types/SupportedSdkLanguage.js.map- this is a generated file in the IR SDK, not touched by this PRThese failures may be pre-existing infrastructure issues. The core TypeScript generator fix has been verified locally.
Human Review Checklist
name(interface property key) rather thansafeName- this was intentional assafeNamedidn't work@exampleJSDoc comments still show duplicatekeyentries - this is a separate issue inRequestWrapperExampleGeneratorthat could be addressed in a follow-up PR