@@ -558,7 +558,7 @@ export default class ConsumedThing extends TD.Thing implements IConsumedThing {
558558
559559 const content = await client . readResource ( form ) ;
560560 try {
561- return this . handleInteractionOutput ( content , form , tp ) ;
561+ return this . handleInteractionOutput ( content , form , tp , false ) ;
562562 } catch ( e ) {
563563 const error = e instanceof Error ? e : new Error ( JSON . stringify ( e ) ) ;
564564 throw new Error ( `Error while processing property for ${ tp . title } . ${ error . message } ` ) ;
@@ -568,7 +568,8 @@ export default class ConsumedThing extends TD.Thing implements IConsumedThing {
568568 private handleInteractionOutput (
569569 content : Content ,
570570 form : TD . Form ,
571- outputDataSchema : WoT . DataSchema | undefined
571+ outputDataSchema : WoT . DataSchema | undefined ,
572+ ignoreValidation : boolean
572573 ) : InteractionOutput {
573574 // infer media type from form if not in response metadata
574575 content . type ??= form . contentType ?? "application/json" ;
@@ -583,7 +584,7 @@ export default class ConsumedThing extends TD.Thing implements IConsumedThing {
583584 ) ;
584585 }
585586 }
586- return new InteractionOutput ( content , form , outputDataSchema ) ;
587+ return new InteractionOutput ( content , form , outputDataSchema , { ignoreValidation } ) ;
587588 }
588589
589590 async _readProperties ( propertyNames : string [ ] ) : Promise < WoT . PropertyReadMap > {
@@ -703,7 +704,8 @@ export default class ConsumedThing extends TD.Thing implements IConsumedThing {
703704
704705 const content = await client . invokeResource ( form , input ) ;
705706 try {
706- return this . handleInteractionOutput ( content , form , ta . output ) ;
707+ const ignoreValidation = ta . synchronous === undefined ? true : ! ta . synchronous ;
708+ return this . handleInteractionOutput ( content , form , ta . output , ignoreValidation ) ;
707709 } catch ( e ) {
708710 const error = e instanceof Error ? e : new Error ( JSON . stringify ( e ) ) ;
709711 throw new Error ( `Error while processing action for ${ ta . title } . ${ error . message } ` ) ;
@@ -746,7 +748,7 @@ export default class ConsumedThing extends TD.Thing implements IConsumedThing {
746748 // next
747749 ( content ) => {
748750 try {
749- listener ( this . handleInteractionOutput ( content , form , tp ) ) ;
751+ listener ( this . handleInteractionOutput ( content , form , tp , false ) ) ;
750752 } catch ( e ) {
751753 const error = e instanceof Error ? e : new Error ( JSON . stringify ( e ) ) ;
752754 warn ( `Error while processing observe property for ${ tp . title } . ${ error . message } ` ) ;
@@ -802,7 +804,7 @@ export default class ConsumedThing extends TD.Thing implements IConsumedThing {
802804 formWithoutURITemplates ,
803805 ( content ) => {
804806 try {
805- listener ( this . handleInteractionOutput ( content , form , te . data ) ) ;
807+ listener ( this . handleInteractionOutput ( content , form , te . data , false ) ) ;
806808 } catch ( e ) {
807809 const error = e instanceof Error ? e : new Error ( JSON . stringify ( e ) ) ;
808810 warn ( `Error while processing event for ${ te . title } . ${ error . message } ` ) ;
0 commit comments