From 9b3c841b0d584a6f8b0f3759aa1b18806ec6860d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sugawara=20=28=E2=88=A9=EF=BD=80-=C2=B4=29?= =?UTF-8?q?=E2=8A=83=E2=94=81=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E?= Date: Thu, 15 May 2025 14:39:30 -0700 Subject: [PATCH 1/2] Add a test for explicit payload member and empty body responses --- .../model/restJson1/http-payload.smithy | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy b/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy index 57a89b19414..a0b4d62d2e0 100644 --- a/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy @@ -281,6 +281,20 @@ apply HttpPayloadWithStructure @httpResponseTests([ } ]) +apply HttpPayloadWithStructure @httpResponseTests([ + { + id: "RestJsonHttpPayloadWithStructureAndEmptyResponseBody", + documentation: "Serializes a structure in the payload", + protocol: restJson1, + code: 200, + body: "", + bodyMediaType: "application/json", + params: { + nested: null + } + } +]) + structure HttpPayloadWithStructureInputOutput { @httpPayload nested: NestedPayload, From 1d2e8f4bc281bf5564d8eadcbadfaa042f3dfe8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sugawara=20=28=E2=88=A9=EF=BD=80-=C2=B4=29?= =?UTF-8?q?=E2=8A=83=E2=94=81=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E=E7=82=8E?= Date: Tue, 20 May 2025 10:59:15 -0700 Subject: [PATCH 2/2] Remove body media-type, this won't be set by servers --- smithy-aws-protocol-tests/model/restJson1/http-payload.smithy | 1 - 1 file changed, 1 deletion(-) diff --git a/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy b/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy index a0b4d62d2e0..d7b8e545ee5 100644 --- a/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/http-payload.smithy @@ -288,7 +288,6 @@ apply HttpPayloadWithStructure @httpResponseTests([ protocol: restJson1, code: 200, body: "", - bodyMediaType: "application/json", params: { nested: null }