From fc685873ba942d6807a1876c08a120a2e282cb05 Mon Sep 17 00:00:00 2001 From: JordonPhillips Date: Mon, 28 Feb 2022 17:46:31 +0100 Subject: [PATCH] Clarify aws http payload binding error Resolves #1078 --- .../aws/traits/protocols/ProtocolHttpPayloadValidator.java | 4 ++-- ...ws-protocols-do-not-support-list-set-map-payloads.errors | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/protocols/ProtocolHttpPayloadValidator.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/protocols/ProtocolHttpPayloadValidator.java index 6529073473c..3648abce6c2 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/protocols/ProtocolHttpPayloadValidator.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/protocols/ProtocolHttpPayloadValidator.java @@ -95,8 +95,8 @@ private List validateService( private Optional validateBindings(Model model, Collection payloadBindings) { for (HttpBinding binding : payloadBindings) { if (!payloadBoundToValidType(model, binding.getMember().getTarget())) { - return Optional.of(error(binding.getMember(), "AWS Protocols do not support applying the httpPayload " - + "trait to members that target sets, lists, or maps.")); + return Optional.of(error(binding.getMember(), "AWS Protocols only support binding the " + + "following shape types to the payload: string, blob, structure, union, and document")); } } return Optional.empty(); diff --git a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/protocols/aws-protocols-do-not-support-list-set-map-payloads.errors b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/protocols/aws-protocols-do-not-support-list-set-map-payloads.errors index 1809266f026..7342a67c196 100644 --- a/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/protocols/aws-protocols-do-not-support-list-set-map-payloads.errors +++ b/smithy-aws-traits/src/test/resources/software/amazon/smithy/aws/traits/errorfiles/protocols/aws-protocols-do-not-support-list-set-map-payloads.errors @@ -1,3 +1,3 @@ -[ERROR] smithy.example#InvalidBindingOperationInput$listBinding: AWS Protocols do not support applying the httpPayload trait to members that target sets, lists, or maps. | ProtocolHttpPayload -[ERROR] smithy.example#InvalidBindingOperationOutput$mapBinding: AWS Protocols do not support applying the httpPayload trait to members that target sets, lists, or maps. | ProtocolHttpPayload -[ERROR] smithy.example#InvalidBindingError$setBinding: AWS Protocols do not support applying the httpPayload trait to members that target sets, lists, or maps. | ProtocolHttpPayload +[ERROR] smithy.example#InvalidBindingOperationInput$listBinding: AWS Protocols only support binding the following shape types to the payload: string, blob, structure, union, and document | ProtocolHttpPayload +[ERROR] smithy.example#InvalidBindingOperationOutput$mapBinding: AWS Protocols only support binding the following shape types to the payload: string, blob, structure, union, and document | ProtocolHttpPayload +[ERROR] smithy.example#InvalidBindingError$setBinding: AWS Protocols only support binding the following shape types to the payload: string, blob, structure, union, and document | ProtocolHttpPayload