Skip to content

Commit

Permalink
fix(parser): filtering already existing parent definitions to overcom…
Browse files Browse the repository at this point in the history
…e recursion

fixes problems with overflowing stack with recursive model definitions
  • Loading branch information
vmasek committed Jun 24, 2020
1 parent c334b18 commit e292567
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,13 @@ function parseDefinitions(
definitionName === prop.typescriptType,
)
? a // do not parse if type def already exists in parsed definitions
: [...a, ...filterByName(prop.typescriptType!, namedDefs)],
: [
...a,
...filterByName(prop.typescriptType!, [
...parentDefs,
...namedDefs,
]),
],
[],
),
],
Expand Down

0 comments on commit e292567

Please sign in to comment.