-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack overflow on recursive schemas #8
Comments
Totally valid point. I knew this will happen, I just didn't consider the recursive structure as a common use-case. I'll take a look. Thanks! |
Here is an outline of how I fixed it in our library (which was written by an intern so we are looking to replace with swagger-brake): I created a set to remember the path:
The method to determine if 2 types are the same looks like this:
|
galovics
added a commit
that referenced
this issue
Dec 9, 2018
Fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We had our own library that tried to do what swagger-brake is doing and ran into the same problem.
The solution is that you have to remember where you have been when recursing and don't recurse into a schema you have already seen on the way down.
Here is a simplified swagger spec that causes the stack overflow. Note that PaymentItemDTO contains an array of children PaymentItemDTO objects.
The text was updated successfully, but these errors were encountered: