From 39482265420c3f977e4b83b778c73c8018479d1c Mon Sep 17 00:00:00 2001 From: Jonathan Gould Date: Thu, 9 Apr 2026 07:14:14 -0400 Subject: [PATCH] Force use of cache for $ref objects --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f85e2212..638eb2c9 100644 --- a/index.js +++ b/index.js @@ -568,7 +568,7 @@ function buildObject (context, location, input) { const jsonPointer = location.jsonPointer || '' const fullPath = `${schemaId}#${jsonPointer}` - if (context.recursivePaths.has(fullPath) || context.buildingSet.has(schema)) { + if (context.recursivePaths.has(fullPath) || context.buildingSet.has(schema) || (schemaId && schemaId !== '')) { const functionName = generateFuncName(context) context.functionsNamesBySchema.set(schema, functionName) @@ -627,7 +627,7 @@ function buildArray (context, location, input) { const jsonPointer = location.jsonPointer || '' const fullPath = `${schemaId}#${jsonPointer}` - if (context.recursivePaths.has(fullPath) || context.buildingSet.has(schema)) { + if (context.recursivePaths.has(fullPath) || context.buildingSet.has(schema) || (schemaId && schemaId !== '')) { const functionName = generateFuncName(context) context.functionsNamesBySchema.set(schema, functionName)