Skip to content

Commit b218ed2

Browse files
authored
fix: HTTPAPIKeyAuthTrait initialization (#553)
1 parent 13967c4 commit b218ed2

File tree

1 file changed

+4
-1
lines changed
  • packages/smithy-core/src/smithy_core

1 file changed

+4
-1
lines changed

packages/smithy-core/src/smithy_core/traits.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,14 @@ class HTTPAPIKeyAuthTrait(Trait, id=ShapeID("smithy.api#httpApiKeyAuth")):
335335

336336
def __init__(self, value: "DocumentValue | DynamicTrait" = None):
337337
super().__init__(value)
338-
object.__setattr__(self, "location", APIKeyLocation(value))
339338
assert isinstance(self.document_value, Mapping)
339+
assert isinstance(self.document_value["in"], str)
340340
assert isinstance(self.document_value["name"], str)
341341
assert isinstance(self.document_value.get("scheme"), str | None)
342342

343+
location = self.document_value["in"]
344+
object.__setattr__(self, "location", APIKeyLocation(location))
345+
343346
@property
344347
def name(self) -> str:
345348
return self.document_value["name"] # type: ignore

0 commit comments

Comments
 (0)