@@ -79,6 +79,10 @@ export function reduceDependencies({ node, data, key, pointer, path }: JsonSchem
79
79
return true ;
80
80
}
81
81
82
+ if ( Array . isArray ( dependency . schema . required ) ) {
83
+ required . push ( ...dependency . schema . required ) ;
84
+ }
85
+
82
86
// @note pass on updated required-list to resolve nested dependencies. This is currently supported,
83
87
// but probably not how json-schema spec defines this behaviour (resolve only within sub-schema)
84
88
const reducedDependency = { ...dependency , schema : { ...dependency . schema , required } } . reduceNode ( data , {
@@ -88,9 +92,6 @@ export function reduceDependencies({ node, data, key, pointer, path }: JsonSchem
88
92
} ) . node ;
89
93
90
94
workingNode = mergeNode ( workingNode , reducedDependency ) ;
91
- if ( workingNode . schema . required ) {
92
- required . push ( ...workingNode . schema . required ) ;
93
- }
94
95
95
96
// @dynamicId
96
97
const nestedDynamicId = reducedDependency . dynamicId ?. replace ( node . dynamicId , "" ) ?? "" ;
@@ -103,10 +104,6 @@ export function reduceDependencies({ node, data, key, pointer, path }: JsonSchem
103
104
return node ;
104
105
}
105
106
106
- // mergedSchema = mergeSchema(node.schema, mergedSchema, "dependencies");
107
- // const { node: childNode, error } = node.compileSchema(mergedSchema, node.evaluationPath).reduceNode(data, { path });
108
- // return childNode ?? error;
109
-
110
107
if ( required . length === 0 ) {
111
108
return workingNode ;
112
109
}
0 commit comments