You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating a python client using the current snapshot of the openapi generator, an circular import occurs when a discriminator is inherited via AllOf.
Bug Report Checklist
Have you provided a full/minimal spec to reproduce the issue?
Have you validated the input using an OpenAPI validator (example)?
What's the actual output vs expected output?
Expected output:
Running tests via python -m pytest . passes
Acutal output:
ImportError while importing test module '/home/thoerberg/Documents/Work/repositories/vcd_cloudapi/test/test_group.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
../test/test_group.py:18: in <module>
from vcd_cloudapi.models.group import Group # noqa: E501
../vcd_cloudapi/models/group.py:23: in <module>
from vcd_cloudapi.models.presentation_element import PresentationElement
../vcd_cloudapi/models/presentation_element.py:105: in <module>
from vcd_cloudapi.models.group import Group
E ImportError: cannot import name 'Group' from partially initialized module 'vcd_cloudapi.models.group' (most likely due to a circular import) (/home/thoerberg/Documents/Work/repositories/vcd_cloudapi/vcd_cloudapi/models/group.py)
When generating a python client using the current snapshot of the openapi generator, an circular import occurs when a discriminator is inherited via AllOf.
Bug Report Checklist
Expected output:
Running tests via
python -m pytest .
passesAcutal output:
Description
see above
openapi-generator version
the latest Snapshot/freshly built binary
OpenAPI declaration file content or url
Generation Details
Suggest a fix
See: PR #16809
The text was updated successfully, but these errors were encountered: