Recursive schema reference errors
Loving the openapi-gui so far and would like to use it, but some of my schemas have recursive references at the child level and at the grandchild level. This causes callstack errors in Chrome and "too many recursion" errors in Firefox when clicking a schemas edit icon.
Any chance you can add in child schema tracking to detect recursion and render recursive schema children, grandchildren, etc... with a placeholder like they do in redoc?
Thanks!
I've built a webpack bundle from reftools which has better recurse and dereferencing routines, so I will move over to that.
I don't suppose you have a short repro test case you could share?
Thanks for reporting!
Wow! Thanks for the quick response.
Here is a sample with multiple recursive references. Let me know if that helps.
Cheers!
Not sure if the sample will come through on my email reply. Here it is again just in case.
Ok, it was the jsonEditor component itself which couldn't handle the recursive schemas, so now we replace the recursive properties with $refs again (after dereferencing them originally). I still don't think it's the ideal component for editing / viewing complex schemas, but I'm still looking for a good replacement.
It would be great if you could retest and confirm the crash is gone.
Hi Mike,
It loads now without any recursion errors. But any object that gets opened up, the $ref paths get all messed up now when downloading the schema after viewing it in the jsonEditor.
See the User component in the schema below. The $ref on properties of the User components are now "#/items/oneof/...." instead of "#/components/..."
Thanks again for looking into this recursion issue!
OK, I've moved the 'fix' to another branch and reverted it on master for now, until the $ref path is fixed and tested. Shouldn't take long as the routine used has an option for this.