Skip to content

Commit 4d41040

Browse files
adamthom-amznJordonPhillips
authored andcommitted
chore: disable idempotency autofill import when not generating a client (aws#2181)
1 parent 5917de0 commit 4d41040

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
@@ -221,6 +221,10 @@ static boolean writeXmlNamespace(GenerationContext context, Shape shape, String
221221
* @param context The generation context.
222222
*/
223223
static void addItempotencyAutofillImport(GenerationContext context) {
224+
// servers do not autogenerate idempotency tokens during deserialization
225+
if (!context.getSettings().generateClient()) {
226+
return;
227+
}
224228
context.getModel().shapes(MemberShape.class)
225229
.filter(memberShape -> memberShape.hasTrait(IdempotencyTokenTrait.class))
226230
.findFirst()

0 commit comments

Comments
 (0)