From 76417a276c302726bd210bc3751ac9bfe274a334 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 13 Oct 2020 18:37:28 +0300 Subject: [PATCH] fix: exit recursive interface generation when ref is cyclic --- npm/ng-packs/packages/schematics/src/utils/model.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index f68aa9b181..f1177d2340 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -134,7 +134,8 @@ export function createImportRefToInterfaceReducerCreator(params: ModelGeneratorP return _interface.properties .reduce((refs, prop) => { prop.refs.forEach(type => { - if (types[type]?.isEnum || type === _interface.ref) return; + if (types[type]?.isEnum) return; + if (interfaces.some(i => i.ref === type)) return; refs.push(type); });