-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
CodeGen - Self referencing array in json schema results in stackoverflow #236
Comments
This is probably a bug, since self references are something I was not expecting when I wrote the generator. Most probably the solution is to put a barrier somewhere to prevent reentrancy when it detects that some type is already in. basically _UseType needs to cache the result value in some dictionary, and if it _UseType is called again with the same parameters, use the cached value in the dictionary instead of doing a full reprocessing. I am extremely busy lately, so I don't know when I'll have time to look into it. If you're in a hurry, I would suggest to try fix it yourself, and maybe create a pull request with the solution. |
I investigated this type of error and it is exactly the error you mentioned. What i did is created a list of already processed schemas and hold them in a cache like dictonary. Then i tried replacing the current processing schema, which was already processed in the cache, with an placeholder schema. This is how it looks currently:
|
I've found this: https://stackoverflow.com/questions/35250621/recursive-self-referencing-json-schema Not sure if it's relevant to the issue |
Hey Folks,
can someone provide me a helping hand in this scenario:
I have a schema defined, which should have some data and can have multiple objects of itself in an array like defined below:
But when running the CodeGen Tool it is resulting in an stackoverflow:
how would i prevent that, or tell the codegen tool that it should only process this node on the top level once and reference it then?
I cant find anything like my schema in the already defined schemas and i cant seem to find a apropriate function in the codegen tool, thats why im out of expertise here.
Thanks in advance!
The text was updated successfully, but these errors were encountered: