-
-
Notifications
You must be signed in to change notification settings - Fork 32
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] Pydantic model fields don't display in documentation #123
Comments
Hello @ysfchn, my apologies, I realize I never answered to your issue. Please note you can definitely ping me next time if you don't get an answer 😅 Did you manage to find a workaround, or did you just stop using mkdocstrings? I kinda stopped working on pytkdocs because I was busy bringing an improved version to life (Griffe). Maybe you should try with the new Python handler 🙂 |
No problem! I realized the right way to do was defining all attributes in root of class definition instead of adding docstring under every field. So I closed the issue as it is not relevant anymore. I still use mkdocstrings and currently works great so far! 👍 |
I see, thanks! I'm glad mkdocstrings is working for you 🙂 |
Hi, I'm having a similar issue, but the default always says required, I'm assuming that's because there's no |
Describe the bug
I just saw the issue #9, and it looks like Pydantic models are supported, however I couldn't manage adding a Pydantic model in documentation. I use
pytkdocs
throughmkdocstrings
so I didn't installpytkdocs
myself, it is installed withmkdocstrings
.Am I doing something wrong?
To Reproduce
I referenced the model like this, (I also tried clearing the filters and enabled inherited_members to see if I can solve myself, but it didn't work anyway.) however only Pydantic's own methods shows up, nothing more.
relay/models.py
reference2.md
Expected behavior
It should display attributes of a Pydantic model.
Screenshots
System (please complete the following information):
pytkdocs
version:0.12.0
(installed automatically withmkdocstrings==0.16.0
)Additional context
pydantic version:
1.8.2
docs/requirements.txt
mkdocs.yml (partial - only
mkdocstrings
part)I also have a custom CSS to hide keyword arguments:
Edit: Looks like attributes only shows up as table when I add
Attributes
section to model's own docstring. But I expected to see all attributes without adding them to model's own docstring.The text was updated successfully, but these errors were encountered: