File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export class InteractionOutput implements WoT.InteractionOutput {
4242 dataUsed : boolean ;
4343 form ?: WoT . Form ;
4444 schema ?: WoT . DataSchema ;
45- enforceValidation : boolean ; // by default set to true
45+ ignoreValidation : boolean ; // by default set to false
4646
4747 public get data ( ) : ReadableStream {
4848 if ( this . #stream) {
@@ -62,7 +62,7 @@ export class InteractionOutput implements WoT.InteractionOutput {
6262 this . #content = content ;
6363 this . form = form ;
6464 this . schema = schema ;
65- this . enforceValidation = ignoreValidation === undefined ? true : ! ignoreValidation ;
65+ this . ignoreValidation = ignoreValidation ?? false ;
6666 this . dataUsed = false ;
6767 }
6868
@@ -124,7 +124,7 @@ export class InteractionOutput implements WoT.InteractionOutput {
124124 // validate the schema
125125 const validate = ajv . compile < T > ( this . schema ) ;
126126
127- if ( this . enforceValidation && ! validate ( json ) ) {
127+ if ( ! this . ignoreValidation && ! validate ( json ) ) {
128128 debug ( `schema = ${ util . inspect ( this . schema , { depth : 10 , colors : true } ) } ` ) ;
129129 debug ( `value: ${ json } ` ) ;
130130 debug ( `Errror: ${ validate . errors } ` ) ;
You can’t perform that action at this time.
0 commit comments