diff --git a/smithy-aws-protocol-tests/model/restJson1/malformedRequests/malformed-union.smithy b/smithy-aws-protocol-tests/model/restJson1/malformedRequests/malformed-union.smithy index cd0ca8cd477..ab4571cdb51 100644 --- a/smithy-aws-protocol-tests/model/restJson1/malformedRequests/malformed-union.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/malformedRequests/malformed-union.smithy @@ -78,6 +78,28 @@ apply MalformedUnion @httpMalformedRequestTests([ } } }, + { + id: "RestJsonMalformedUnionEmptyObjectNoFieldsSet", + documentation: """ + When the union is an empty object, it has no fields set, so the + response should be a 400 SerializationException.""", + protocol: restJson1, + request: { + method: "POST", + uri: "/MalformedUnion", + body: """ + { "union" : { } }""", + headers: { + "content-type": "application/json" + } + }, + response: { + code: 400, + headers: { + "x-amzn-errortype": "SerializationException" + } + } + }, { id: "RestJsonMalformedUnionValueIsArray", documentation: """