Skip to content

fix: handle clientContextParam collisions with builtin config keys #1788

Merged
smilkuri merged 12 commits intomainfrom
resolve-conflict-params
Dec 15, 2025
Merged

fix: handle clientContextParam collisions with builtin config keys #1788
smilkuri merged 12 commits intomainfrom
resolve-conflict-params

Conversation

@smilkuri
Copy link
Copy Markdown
Contributor

@smilkuri smilkuri commented Nov 24, 2025

Issue #, if available:

#1779
codegen v3:aws/aws-sdk-js-v3#7549

Description of changes:

This fixes TypeScript client codegen conflict between known config keys and clientContextParams by adding the nested clientContextParams object to isolate conflicting parameters while maintaining backward compatibility and proper precedence.

--

@smilkuri smilkuri force-pushed the resolve-conflict-params branch from 4a0b1ea to c0cc0c7 Compare November 26, 2025 16:57
@smilkuri smilkuri force-pushed the resolve-conflict-params branch from f3ea1fe to 13fd0f0 Compare December 1, 2025 16:16
@smilkuri smilkuri marked this pull request as ready for review December 1, 2025 16:57
@smilkuri smilkuri requested a review from a team as a code owner December 1, 2025 16:57
@smilkuri smilkuri force-pushed the resolve-conflict-params branch 2 times, most recently from 9117008 to 1fc37f8 Compare December 1, 2025 17:01
@smilkuri smilkuri changed the title fix: nest conflicting endpoint parameters fix: handle clientContextParam collisions with builtin config keys Dec 1, 2025
Comment thread packages/middleware-endpoint/src/adaptors/getEndpointFromInstructions.ts Outdated
Comment thread packages/middleware-endpoint/src/adaptors/createConfigValueProvider.ts Outdated
Comment thread .changeset/stale-phones-behave.md
@smilkuri smilkuri force-pushed the resolve-conflict-params branch from ef3cda8 to c5f0d86 Compare December 1, 2025 20:11
Comment thread private/my-local-model-schema/src/endpoint/EndpointParameters.ts
Comment thread packages/middleware-endpoint/src/adaptors/createConfigValueProvider.ts Outdated
if (isClientContextParam) {
// For client context parameters, check clientContextParams first
const clientContextParams = config.clientContextParams as Record<string, unknown> | undefined;
const nestedValue: unknown = clientContextParams?.[configKey] ?? clientContextParams?.[canonicalEndpointParamKey];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any case where the nested object does not use the canonical parameter key?

If not, there's no reason to check the configKey entry for the nested object.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so

Copy link
Copy Markdown
Contributor

@kuhe kuhe Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clientContextParams?.[configKey] ?? clientContextParams?.[canonicalEndpointParamKey];

is canonicalEndpointParamKey ApiKey and configKey apiKey?
if they are different then both still need to be checked

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clientContextParams uses a local name so wouldn't it be just clientContextParams?.[configKey] do we still need to check clientContextParams?.[canonicalEndpointParamKey]?

Comment thread packages/middleware-endpoint/src/adaptors/getEndpointFromInstructions.ts Outdated
Comment thread private/my-local-model/src/endpoint/EndpointParameters.ts Outdated
Comment thread private/my-local-model/src/endpoint/ruleset.ts
Comment thread packages/eventstream-serde-universal/src/eventstream-cbor.integ.spec.ts Outdated
Comment thread packages/middleware-endpoint/src/adaptors/createConfigValueProvider.spec.ts Outdated
Comment thread packages/util-retry/src/retries.integ.spec.ts Outdated
Comment thread private/my-local-model-schema/src/auth/httpAuthSchemeProvider.ts
Comment thread private/my-local-model-schema/src/endpoint/EndpointParameters.ts
Comment thread private/my-local-model-schema/src/endpoint/EndpointParameters.ts
Comment thread private/my-local-model-schema/src/endpoint/EndpointParameters.ts
@@ -1,5 +1,5 @@
// smithy-typescript generated code
import type { HttpAuthScheme } from "@smithy/types";
import { type HttpAuthScheme, ApiKeyIdentity, ApiKeyIdentityProvider } from "@smithy/types";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change these to type imports

Comment thread private/my-local-model/src/auth/httpAuthSchemeProvider.ts
@smilkuri smilkuri force-pushed the resolve-conflict-params branch 3 times, most recently from 7016448 to 5401b57 Compare December 10, 2025 15:57
Comment thread smithy-typescript-protocol-test-codegen/model/my-local-model/main.smithy Outdated
Comment thread private/my-local-model-schema/src/XYZServiceClient.ts Outdated
Comment thread private/my-local-model-schema/src/auth/httpAuthExtensionConfiguration.ts Outdated
Comment thread smithy-typescript-protocol-test-codegen/model/my-local-model/main.smithy Outdated
@smilkuri smilkuri force-pushed the resolve-conflict-params branch 2 times, most recently from c848d0a to fee039f Compare December 11, 2025 18:48
@smilkuri smilkuri force-pushed the resolve-conflict-params branch 2 times, most recently from 7f2389e to 17d3116 Compare December 15, 2025 19:08
@smilkuri smilkuri force-pushed the resolve-conflict-params branch from 17d3116 to 7383a37 Compare December 15, 2025 19:26
@smilkuri smilkuri force-pushed the resolve-conflict-params branch from 7383a37 to 596c0a3 Compare December 15, 2025 19:39
@smilkuri smilkuri merged commit 76d7994 into main Dec 15, 2025
13 checks passed
@smilkuri smilkuri deleted the resolve-conflict-params branch December 15, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants