-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix isNotRecurringNestStruct function
Currently, the function does not use its refTypeName parameter; instead it checks that the 1st structure in the structures stack does not repeat. Recursion, however, can be indirect. Consider the following example: type Foo struct { Bar Bar } type Bar struct { Foo Foo } type Baz struct { Foo Foo } In the example generator will crash with stack overflow while trying to generate spec for Baz when there is no spec for Foo and Bar generated yet. The fix is to check that refTypeName does not repeat in the structures stack.
- Loading branch information
Nikolai Obedin
committed
Nov 7, 2018
1 parent
cea5516
commit fd49f74
Showing
4 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters