-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support for Union with ForwardRef #98
Comments
@Czaki Thanks for sharing this issue. It is definitely a bug. I can reproduce the behavior and it boils down to recursively check |
@Czaki This should be fixed via #102. Before merging the related PR, it would be great if you could test the bug fix on your site to confirm that my test case did indeed capture the incorrect behavior which you've encountered. To do so, please install the current dev release in your doc-building-environment via |
@all-contributors please add @Czaki for bug |
I've put up a pull request to add @Czaki! 🎉 |
@Czaki Please feel free to reopen this ticket if the issue persists. |
for code:
there was warning
/home/czaki/Projekty/PartSeg/docs/autodoc_pydantic.rst: WARNING: JSON schema can't be generated for 'PartSegCore.analysis.measurement_base.Node' because the following pydantic fields can't be serialized properly: ['left', 'right'].
in this code
autodoc_pydantic/sphinxcontrib/autodoc_pydantic/inspection.py
Lines 183 to 189 in 36ffae3
there is no check for
sub_fields
:https://github.com/samuelcolvin/pydantic/blob/fbf8002cefd1ba7b263f63545fff2e48a378189d/pydantic/typing.py#L445-L458
in my case
field.type_
istyping.Union[ForwardRef('Node'), PartSegCore.analysis.measurement_base.Leaf]
butfield.sub_fields
is[ModelField(name="left_ForwardRef('Node')", type=Node, required=True), ModelField(name='left_Leaf', type=Leaf, required=True)]
So all data are available in data structures.
The text was updated successfully, but these errors were encountered: