-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[BUG][Python] Stackoverflow error when using required recursive properties #7532
Comments
I was just about to file a report for the same issue. It is still there in the latest master as of writing this (now at 5.1.0-SNAPSHOT). Here is a repo to easily reproduce, in case it helps. Note: The suggested validator in the issue filing system complains about the recursive type, but e.g. the Swagger online editor does not. In any case, clearly one has to be allowed to have recursive types for trees etc. @vincent-raman, could you file a PR, since you found a fix? Otherwise, I might take a crack at it |
Also fails in |
The above PR fixes the java layer of python clients |
I still appear to be getting this error (or at least one very similiar to it) when using |
It seems fixed in python-prior (renamed from python) in v6.2.0 |
Description
If we want to define a recursive type (like a tree), the client generation for python crashes with a StackOverflowError in the
PythonClientCodegen.toExampleValueRecursive
method.openapi-generator version
4.3.1
OpenAPI declaration file content or url
Generation Details
Generation of a client with language "python" and this schema definition
Steps to reproduce
Try to generate a python client
Suggest a fix
In the method
PythonClientCodegen.toExampleValueRecursive
, when treating an object (if (ModelUtils.isObjectSchema(schema))
, the already treated properties are removed.But, just after, the "required" properties are added back, making this safeguard useless
The text was updated successfully, but these errors were encountered: