@@ -27,6 +27,7 @@ import {
2727 SchemaValidatorResult ,
2828 SmartDefaultProvider ,
2929} from './interface' ;
30+ import { JsonSchema } from './schema' ;
3031import { visitJson , visitJsonSchema } from './visitor' ;
3132
3233// This interface should be exported from ajv, but they only export the class and not the type.
@@ -299,7 +300,7 @@ export class CoreSchemaRegistry implements SchemaRegistry {
299300 * (using schema as a URI).
300301 * @returns An Observable of the Validation function.
301302 */
302- compile ( schema : JsonObject ) : Observable < SchemaValidator > {
303+ compile ( schema : JsonSchema ) : Observable < SchemaValidator > {
303304 const schemaInfo : SchemaInfo = {
304305 smartDefaultRecord : new Map < string , JsonObject > ( ) ,
305306 promptDefinitions : [ ] ,
@@ -346,6 +347,10 @@ export class CoreSchemaRegistry implements SchemaRegistry {
346347 // tslint:disable-next-line:no-any https://github.com/ReactiveX/rxjs/issues/3989
347348 result = ( result as any ) . pipe (
348349 ...[ ...this . _pre ] . map ( visitor => concatMap ( ( data : JsonValue ) => {
350+ if ( schema === false || schema === true ) {
351+ return of ( data ) ;
352+ }
353+
349354 return visitJson ( data , visitor , schema , this . _resolver , validate ) ;
350355 } ) ) ,
351356 ) ;
@@ -368,6 +373,9 @@ export class CoreSchemaRegistry implements SchemaRegistry {
368373
369374 return value ;
370375 } ;
376+ if ( schema === false || schema === true ) {
377+ return of ( updatedData ) ;
378+ }
371379
372380 return visitJson ( updatedData , visitor , schema , this . _resolver , validate ) ;
373381 } ) ,
@@ -410,6 +418,10 @@ export class CoreSchemaRegistry implements SchemaRegistry {
410418 // tslint:disable-next-line:no-any https://github.com/ReactiveX/rxjs/issues/3989
411419 result = ( result as any ) . pipe (
412420 ...[ ...this . _post ] . map ( visitor => concatMap ( ( data : JsonValue ) => {
421+ if ( schema === false || schema === true ) {
422+ return of ( schema ) ;
423+ }
424+
413425 return visitJson ( data , visitor , schema , this . _resolver , validate ) ;
414426 } ) ) ,
415427 ) ;
0 commit comments