From 182e96f4d53a3eb3a0b973c395f9c8bb66125232 Mon Sep 17 00:00:00 2001 From: Nate Usher Date: Mon, 8 Sep 2025 10:21:00 -0700 Subject: [PATCH] fix: api key identity resolver config codegen --- .../smithy/python/codegen/integrations/HttpApiKeyAuth.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/integrations/HttpApiKeyAuth.java b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/integrations/HttpApiKeyAuth.java index 819cd2bf0..2c58c7ed2 100644 --- a/codegen/core/src/main/java/software/amazon/smithy/python/codegen/integrations/HttpApiKeyAuth.java +++ b/codegen/core/src/main/java/software/amazon/smithy/python/codegen/integrations/HttpApiKeyAuth.java @@ -63,8 +63,9 @@ public List getClientPlugins(GenerationContext context) { .initialize(writer -> { writer.addImport("smithy_http.aio.identity.apikey", "APIKeyIdentityResolver"); writer.write(""" - if api_key_identity_resolver is None: - api_key_identity_resolver = APIKeyIdentityResolver() + self.api_key_identity_resolver = ( + api_key_identity_resolver or APIKeyIdentityResolver() + ) """); }) .build())