From 533028665fe8d4789a8a20c4119ed8e12f2c552e Mon Sep 17 00:00:00 2001 From: AllanZhengYP Date: Tue, 28 Sep 2021 06:33:26 +0000 Subject: [PATCH] fix(protocol-test): compare xml payload with outmost node --- .../codegen/integration/DocumentMemberSerVisitor.java | 8 ++++++++ .../smithy/typescript/codegen/protocol-test-xml-stub.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/DocumentMemberSerVisitor.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/DocumentMemberSerVisitor.java index 821637b1891..fb7e5bea270 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/DocumentMemberSerVisitor.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/DocumentMemberSerVisitor.java @@ -88,6 +88,14 @@ public DocumentMemberSerVisitor( this.defaultTimestampFormat = defaultTimestampFormat; } + /** + * @return the member this visitor is being run against. Used to discover member-applied + * traits, such as @xmlName. Can be, and defaults, to, null. + */ + protected MemberShape getMemberShape() { + return null; + } + /** * Gets the generation context. * diff --git a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-xml-stub.ts b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-xml-stub.ts index c2b84eec2af..f38c0ed58d2 100644 --- a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-xml-stub.ts +++ b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-xml-stub.ts @@ -24,7 +24,7 @@ const compareEquivalentXmlBodies = ( parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; delete parsedObjToReturn[textNodeName]; } - return parsedObjToReturn; + return parsedObj; }; const expectedParts = parseXmlBody(expectedBody);