From f39875b1abbd057e9865b29e94dac3f0a465ec18 Mon Sep 17 00:00:00 2001 From: Will Osborne Date: Fri, 25 Oct 2024 15:20:50 +0100 Subject: [PATCH] #486 fix condition when instantiating --- cli/src/commands/generate/components/instantiate.ts | 4 ++-- cli/src/commands/generate/generate.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cli/src/commands/generate/components/instantiate.ts b/cli/src/commands/generate/components/instantiate.ts index 0d028fb2..3b57f3cc 100644 --- a/cli/src/commands/generate/components/instantiate.ts +++ b/cli/src/commands/generate/components/instantiate.ts @@ -34,9 +34,9 @@ export function instantiateGenericObject(definition: object, schemaDirectory: Sc if (!!detail?.const) { out[key] = getPropertyValue(key, detail); } - if (detail?.type === 'object') { + else if (detail?.type === 'object') { // recursive instantiation - logger.info(`${renderedPath}: Recursively instantiating an ${objectType} object`); + logger.info(`${renderedPath}: Recursively instantiating a ${objectType} object`); out[key] = instantiateGenericObject(detail, schemaDirectory, objectType, currentPath, instantiateAll, debug); } else if (detail?.type === 'array' && isArrayObjectComplex(detail, logger, renderedPath)) { diff --git a/cli/src/commands/generate/generate.ts b/cli/src/commands/generate/generate.ts index 277875af..2db94250 100644 --- a/cli/src/commands/generate/generate.ts +++ b/cli/src/commands/generate/generate.ts @@ -63,8 +63,6 @@ export async function runGenerate(patternPath: string, outputPath: string, debug const final = await generate(patternPath, debug, instantiateAll, schemaDirectoryPath); const output = JSON.stringify(final, null, 2); - logger.debug('Generated instantiation: ' + output); - const dirname = path.dirname(outputPath); logger.debug('Writing output to ' + outputPath);