From 32a19e0dfbdc290322140972f113009f64658259 Mon Sep 17 00:00:00 2001 From: George Fu Date: Mon, 22 Sep 2025 11:06:31 -0400 Subject: [PATCH 1/2] schema testing --- .../codegen/schema/SchemaGenerationAllowlist.java | 4 ++-- .../typescript/codegen/schema/SchemaGenerator.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerationAllowlist.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerationAllowlist.java index 1360c9f0baa..02c4122a358 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerationAllowlist.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerationAllowlist.java @@ -27,11 +27,11 @@ public abstract class SchemaGenerationAllowlist { @Deprecated public static boolean allows(String serviceShapeId, TypeScriptSettings settings) { - return ALLOWED.contains(serviceShapeId) && settings.generateSchemas(); + return true; } public static boolean allows(ShapeId serviceShapeId, TypeScriptSettings settings) { - return ALLOWED.contains(serviceShapeId.toString()) && settings.generateSchemas(); + return true; } public static void allow(String serviceShapeId) { diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java index 81703842ca3..cfc1dd1d89b 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java @@ -535,12 +535,12 @@ private void writeTraitsInContext(Shape context, Shape shape) { TypeScriptWriter writer = getWriter(context.getId()); boolean useImportedStrings = !groupingIndex.isBaseGroup(context); - writer.write( - new SchemaTraitWriter( - shape, elision, - useImportedStrings ? store.useSchemaWriter(writer) : store - ).toString() - ); + String traitCode = new SchemaTraitWriter( + shape, elision, + useImportedStrings ? store.useSchemaWriter(writer) : store + ).toString(); + + writer.write(traitCode.replace("$", "$$")); } /** From 1d69b4ab42348ba2b57cdf3eb4ad3da6b4892b34 Mon Sep 17 00:00:00 2001 From: George Fu Date: Mon, 22 Sep 2025 11:23:49 -0400 Subject: [PATCH 2/2] client only --- .../typescript/codegen/schema/SchemaGenerationAllowlist.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerationAllowlist.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerationAllowlist.java index 02c4122a358..58e51435f66 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerationAllowlist.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerationAllowlist.java @@ -27,11 +27,11 @@ public abstract class SchemaGenerationAllowlist { @Deprecated public static boolean allows(String serviceShapeId, TypeScriptSettings settings) { - return true; + return settings.generateClient(); } public static boolean allows(ShapeId serviceShapeId, TypeScriptSettings settings) { - return true; + return settings.generateClient(); } public static void allow(String serviceShapeId) {