Skip to content

Conversation

@iamnamananand996
Copy link
Contributor

Description

Linear ticket:

The PR fixes a client name collision issue in the Rust SDK generator, where recursive subpackages with similar names would generate conflicting client class names. For example, folder_a/service and folder_d/service both tried to use ServiceClient, and folder_b/common and folder_c/common both tried to use CommonClient, causing compilation errors.

The fix introduces a centralized client name registry that pre-registers all client names (root + subpackages) during initialization and applies numbered-suffix collision resolution (ServiceClientServiceClient2ServiceClient3).

Changes Made

  • Added registerClientName() and getClientName*() methods to RustFilenameRegistry with numbered-suffix strategy for collision resolution
  • Updated AbstractRustGeneratorContext to pre-register all client names (root + subpackages) during initialization phase (Priority 4)
  • Modified getClientName() and getUniqueClientNameForSubpackage() to retrieve registered names from the registry instead of generating them on-the-fly
  • Updated SdkGeneratorCli to use registered client names for subpackage exports

Testing

  • Manual testing completed - seed tests regenerated and verified
  • Verified collision resolution: ServiceClientServiceClient2, CommonClientCommonClient2, BasicAuthClientBasicAuthClient2

@iamnamananand996 iamnamananand996 merged commit a268636 into main Oct 21, 2025
96 checks passed
@iamnamananand996 iamnamananand996 deleted the namananand/fer-7028-rust-sdk-recursive-client-error-issue branch October 21, 2025 03:38
iamnamananand996 added a commit that referenced this pull request Oct 21, 2025
…9868)

* fix(rust): add clientName to `RustFilenameRegistry` for recursive clientname collision

* chore:update seed
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.

3 participants