private Optional<ValidationEvent> validatePayload(
            ShapeId subject,
            StructureShape inputOrError,
            HttpBindingIndex bindings,
            boolean request
    ) {
        Map<String, HttpBinding> resolved = request
                ? bindings.getRequestBindings(subject)
                : bindings.getResponseBindings(subject);
        Set<String> unbound = resolved.entrySet()
                .stream()
                .filter(binding -> binding.getValue().getLocation() == HttpBinding.Location.UNBOUND)
                .map(Map.Entry::getKey)
                .collect(Collectors.toSet());

        if (!unbound.isEmpty()) {
            return Optional.of(error(inputOrError,
                    String.format(
                            "A member of this structure is marked with the `httpPayload` trait, but the following "
                                    + "structure members are not explicitly bound to the HTTP message: %s",
                            ValidationUtils.tickedList(unbound))));
        }

        return Optional.empty();
    }
Validates that if a payload trait is present then all members of the
input of an operation are bound to part of the message.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpPayloadValidator.java