From 1bcc6378bb7c86d9433c6a2d0da12762828efeb6 Mon Sep 17 00:00:00 2001 From: vanshaj2023 Date: Mon, 30 Mar 2026 16:11:05 +0530 Subject: [PATCH] feat: add dependentSchemas keyword handler --- src/utils/processAST.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/processAST.ts b/src/utils/processAST.ts index 80486736..c9cd0c31 100644 --- a/src/utils/processAST.ts +++ b/src/utils/processAST.ts @@ -350,7 +350,14 @@ const keywordHandlerMap: KeywordHandlerMap = { } return { key: "patternProperties", data: { value: getArrayFromNumber(value.length) } } }, - // "https://json-schema.org/keyword/dependentSchemas": createBasicKeywordHandler("dependentSchemas"), + "https://json-schema.org/keyword/dependentSchemas": (ast, keywordValue, nodes, edges, parentId, nodeDepth, renderedNodes) => { + const propertyNames: string[] = []; + for (const [key, schemaUri] of keywordValue as [string, string][]) { + propertyNames.push(key); + processAST({ ast, schemaUri, nodes, edges, parentId, renderedNodes, childId: key, nodeTitle: `dependentSchemas["${key}"]`, nodeDepth }); + } + return { key: "dependentSchemas", data: { value: propertyNames } }; + }, "https://json-schema.org/keyword/contains": (ast, keywordValue, nodes, edges, parentId, nodeDepth, renderedNodes) => { const value = keywordValue as { contains: string; minContains: number; maxContains: number }; processAST({ ast, schemaUri: value.contains, nodes, edges, parentId, childId: "contains", renderedNodes, nodeTitle: "contains", nodeDepth });