@@ -69,6 +69,9 @@ export function reduceDependencies({ node, data, key, pointer, path }) {
69
69
if ( ! isSchemaNode ( dependency ) ) {
70
70
return true ;
71
71
}
72
+ if ( Array . isArray ( dependency . schema . required ) ) {
73
+ required . push ( ...dependency . schema . required ) ;
74
+ }
72
75
// @note pass on updated required-list to resolve nested dependencies. This is currently supported,
73
76
// but probably not how json-schema spec defines this behaviour (resolve only within sub-schema)
74
77
const reducedDependency = { ...dependency , schema : { ...dependency . schema , required } } . reduceNode ( data , {
@@ -77,9 +80,6 @@ export function reduceDependencies({ node, data, key, pointer, path }) {
77
80
path
78
81
} ) . node ;
79
82
workingNode = mergeNode ( workingNode , reducedDependency ) ;
80
- if ( workingNode . schema . required ) {
81
- required . push ( ...workingNode . schema . required ) ;
82
- }
83
83
// @dynamicId
84
84
const nestedDynamicId = ( _b = ( _a = reducedDependency . dynamicId ) === null || _a === void 0 ? void 0 : _a . replace ( node . dynamicId , "" ) ) !== null && _b !== void 0 ? _b : "" ;
85
85
const localDynamicId = nestedDynamicId === "" ? `dependencies/${ propertyName } ` : nestedDynamicId ;
@@ -89,9 +89,6 @@ export function reduceDependencies({ node, data, key, pointer, path }) {
89
89
if ( workingNode === node ) {
90
90
return node ;
91
91
}
92
- // mergedSchema = mergeSchema(node.schema, mergedSchema, "dependencies");
93
- // const { node: childNode, error } = node.compileSchema(mergedSchema, node.evaluationPath).reduceNode(data, { path });
94
- // return childNode ?? error;
95
92
if ( required . length === 0 ) {
96
93
return workingNode ;
97
94
}
0 commit comments