File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,20 @@ export default class ValidationContext {
1313 this . _deps = { } ;
1414 const { tracker } = ss . _constructorOptions ;
1515 if ( tracker ) {
16- this . _depsAny = new tracker . Dependency ( ) ;
17- this . _schemaKeys . forEach ( ( key ) => {
18- this . _deps [ key ] = new tracker . Dependency ( ) ;
19- } ) ;
16+ const addDeps = ( schema , keys = [ ] ) => {
17+ Object . keys ( schema ) . forEach ( key => {
18+ const schemaElement = schema [ key ] ;
19+ schemaElement . type . definitions && schemaElement . type . definitions . forEach ( def => {
20+ if ( typeof def . type === "object" ) {
21+ addDeps ( def . type . _schema , keys . concat ( key ) ) ;
22+ } else {
23+ const fullKey = keys . concat ( key ) . join ( "." ) ;
24+ this . _deps [ fullKey ] = new tracker . Dependency ( ) ;
25+ }
26+ } )
27+ } ) ;
28+ }
29+ addDeps ( this . _schema ) ;
2030 }
2131 }
2232
You can’t perform that action at this time.
0 commit comments