@@ -715,18 +715,6 @@ private CompletionStage<Void> performWotBasedFeatureMessageValidation(final Mess
715
715
((MessageCommandResponse <JsonValue , ?>) messageCommandResponse )
716
716
.getMessage ();
717
717
718
- if (message .getPayload ().isPresent () && !isJsonMessageContent (message )) {
719
- return CompletableFuture .failedFuture (
720
- WotThingModelPayloadValidationException
721
- .newBuilder ("Could not validate non-JSON message content type <" +
722
- message .getContentType ().orElse ("?" ) + "> for message response subject " +
723
- "<" + message .getSubject () + ">"
724
- )
725
- .dittoHeaders (messageCommandResponse .getDittoHeaders ())
726
- .build ()
727
- );
728
- }
729
-
730
718
// lazily only supply JsonValue if validation is enabled for the message:
731
719
final Supplier <JsonValue > messageCommandPayloadSupplier = () -> {
732
720
if (message .getPayload ().isPresent () && !isJsonMessageContent (message )) {
@@ -742,9 +730,7 @@ private CompletionStage<Void> performWotBasedFeatureMessageValidation(final Mess
742
730
return message .getPayload ().orElse (null );
743
731
};
744
732
745
- final MessageDirection messageDirection = message .getDirection ();
746
- if (messageDirection == MessageDirection .TO &&
747
- messageCommandResponse instanceof SendThingMessageResponse <?> sendThingMessageResponse ) {
733
+ if (messageCommandResponse instanceof SendThingMessageResponse <?> sendThingMessageResponse ) {
748
734
return resolveThingDefinition ()
749
735
.thenCompose (optThingDefinition -> thingModelValidator .validateThingActionOutput (
750
736
optThingDefinition .orElse (null ),
@@ -754,8 +740,7 @@ private CompletionStage<Void> performWotBasedFeatureMessageValidation(final Mess
754
740
sendThingMessageResponse .getDittoHeaders ()
755
741
))
756
742
.thenApply (aVoid -> messageCommandResponse );
757
- } else if (messageDirection == MessageDirection .TO &&
758
- messageCommandResponse instanceof SendFeatureMessageResponse <?> sendFeatureMessageResponse ) {
743
+ } else if (messageCommandResponse instanceof SendFeatureMessageResponse <?> sendFeatureMessageResponse ) {
759
744
final String featureId = sendFeatureMessageResponse .getFeatureId ();
760
745
return resolveThingAndFeatureDefinition (featureId )
761
746
.thenCompose (optDefinitionPair -> thingModelValidator .validateFeatureActionOutput (
0 commit comments