From 8b4ea40aff669fa5b6b0c3886462e0e7e0cff18f Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 14 May 2024 16:32:50 +0000 Subject: [PATCH] add smithy traits dependency --- smithy-typescript-codegen/build.gradle.kts | 1 + .../typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/smithy-typescript-codegen/build.gradle.kts b/smithy-typescript-codegen/build.gradle.kts index 413b3ed111a..c4da63eb2e0 100644 --- a/smithy-typescript-codegen/build.gradle.kts +++ b/smithy-typescript-codegen/build.gradle.kts @@ -39,6 +39,7 @@ dependencies { // Smithy generic dependencies api("software.amazon.smithy:smithy-codegen-core:$smithyVersion") api("software.amazon.smithy:smithy-model:$smithyVersion") + api("software.amazon.smithy:smithy-protocol-traits:$smithyVersion") api("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion") api("software.amazon.smithy:smithy-rules-engine:$smithyVersion") api("software.amazon.smithy:smithy-waiters:$smithyVersion") diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java index 00692201d6c..02c072523e7 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java @@ -10,10 +10,10 @@ import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.ShapeId; import software.amazon.smithy.model.shapes.StructureShape; +import software.amazon.smithy.protocol.traits.Rpcv2CborTrait; import software.amazon.smithy.typescript.codegen.integration.HttpRpcProtocolGenerator; import software.amazon.smithy.utils.SmithyInternalApi; - /** * Generator for Smithy RPCv2 CBOR. */ @@ -26,7 +26,7 @@ public SmithyRpcV2Cbor() { @Override protected String getDocumentContentType() { - return ""; + return "application/cbor"; } @Override @@ -65,7 +65,7 @@ protected void deserializeOutputDocument(GenerationContext generationContext, @Override public ShapeId getProtocol() { - return null; + return Rpcv2CborTrait.ID; } @Override