From 380d84261b4c7822ca00feb0e1527f38d42fc9ca Mon Sep 17 00:00:00 2001 From: CptSchnitz <12687466+CptSchnitz@users.noreply.github.com> Date: Wed, 4 Sep 2024 10:38:18 +0300 Subject: [PATCH] fix: removed id from loaded schema to resolve the ref more than once error --- src/schemas.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/schemas.ts b/src/schemas.ts index e621985..31ed559 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -17,7 +17,11 @@ function loadSpecificSchema(relativePath: string): JSONSchema { throw createConfigError(`schemaNotFoundError`, `Schema not found at path`, { schemaPath: fullPath }); } - return JSON.parse(fs.readFileSync(fullPath, { encoding: 'utf-8' })) as JSONSchema; + const schema = JSON.parse(fs.readFileSync(fullPath, { encoding: 'utf-8' })) as JSONSchema; + + delete schema.$id; + + return schema; } export async function loadSchema(schema: JSONSchema): ReturnType {