Skip to content

Commit 762a554

Browse files
committed
fix: disable idempotency autofill import when not generating a client
1 parent 093ce24 commit 762a554

File tree

1 file changed

+4
-0
lines changed
  • codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen

1 file changed

+4
-0
lines changed

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java

+4
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ static boolean writeXmlNamespace(GenerationContext context, Shape shape, String
218218
* @param context The generation context.
219219
*/
220220
static void addItempotencyAutofillImport(GenerationContext context) {
221+
// servers do not autogenerate idempotency tokens during deserialization
222+
if (!context.getSettings().generateClient()) {
223+
return;
224+
}
221225
context.getModel().shapes(MemberShape.class)
222226
.filter(memberShape -> memberShape.hasTrait(IdempotencyTokenTrait.class))
223227
.findFirst()

0 commit comments

Comments
 (0)