File tree 1 file changed +12
-9
lines changed
packages/angular_devkit/core/src/json/schema
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -186,10 +186,7 @@ export class CoreSchemaRegistry implements SchemaRegistry {
186
186
// in synchronous (if available).
187
187
let validator : Observable < ajv . ValidateFunction > ;
188
188
try {
189
- const maybeFnValidate = this . _ajv . compile ( {
190
- $async : this . _smartDefaultKeyword ? true : undefined ,
191
- ...schema ,
192
- } ) ;
189
+ const maybeFnValidate = this . _ajv . compile ( schema ) ;
193
190
validator = observableOf ( maybeFnValidate ) ;
194
191
} catch ( e ) {
195
192
// Propagate the error.
@@ -293,8 +290,8 @@ export class CoreSchemaRegistry implements SchemaRegistry {
293
290
this . _smartDefaultKeyword = true ;
294
291
295
292
this . _ajv . addKeyword ( '$default' , {
296
- modifying : true ,
297
- async : true ,
293
+ errors : false ,
294
+ valid : true ,
298
295
compile : ( schema , _parentSchema , it ) => {
299
296
// We cheat, heavily.
300
297
this . _smartDefaultRecord . set (
@@ -303,9 +300,15 @@ export class CoreSchemaRegistry implements SchemaRegistry {
303
300
schema ,
304
301
) ;
305
302
306
- return function ( ) {
307
- return Promise . resolve ( true ) ;
308
- } ;
303
+ return ( ) => true ;
304
+ } ,
305
+ metaSchema : {
306
+ type : 'object' ,
307
+ properties : {
308
+ '$source' : { type : 'string' } ,
309
+ } ,
310
+ additionalProperties : true ,
311
+ required : [ '$source' ] ,
309
312
} ,
310
313
} ) ;
311
314
}
You can’t perform that action at this time.
0 commit comments