Skip to content

Commit 1a5b97f

Browse files
committed
update: pointer in dependencies
1 parent 00126ac commit 1a5b97f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/keywords/dependencies.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function parseDependencies(node: SchemaNode) {
3939
});
4040
}
4141

42-
export function reduceDependencies({ node, data, key, path }: JsonSchemaReducerParams) {
42+
export function reduceDependencies({ node, data, key, pointer, path }: JsonSchemaReducerParams) {
4343
if (!isObject(data)) {
4444
// @todo remove dependentSchemas
4545
return node;
@@ -83,6 +83,7 @@ export function reduceDependencies({ node, data, key, path }: JsonSchemaReducerP
8383
// but probably not how json-schema spec defines this behaviour (resolve only within sub-schema)
8484
const reducedDependency = { ...dependency, schema: { ...dependency.schema, required } }.reduceNode(data, {
8585
key,
86+
pointer: `${pointer}/dependencies/${propertyName}`,
8687
path
8788
}).node;
8889

src/keywords/oneOf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export function reduceOneOfDeclarator({ node, data, pointer, path }: JsonSchemaR
122122
declarator: DECLARATOR_ONEOF,
123123
oneOfProperty,
124124
schemaPointer: node.oneOf[i].schemaId,
125-
pointer,
125+
pointer: `${pointer}/oneOf/${i}`,
126126
schema: node.schema,
127127
value: data
128128
});

0 commit comments

Comments
 (0)