Skip to content
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

Does autodoc_pydantic work with autoapi? #138

Closed
csm10495 opened this issue Sep 27, 2022 · 4 comments
Closed

Does autodoc_pydantic work with autoapi? #138

csm10495 opened this issue Sep 27, 2022 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@csm10495
Copy link

csm10495 commented Sep 27, 2022

I'm not fully initiated into sphinx so some terms may be slightly off so bear with me :)

I have a project that uses sphinx autoapi to build some rst files from code for docs. I figured adding sphinxcontrib.autodoc_pydantic" as an extension in conf.py would be enough to get the description from pydantic fields in the documentation... but alas it doesn't seem to make a difference.

Does this generally work with projects that generate docs via autoapi?

In my conf.py:

..
extensions = [
    "autoapi.extension",
    "sphinxcontrib.autodoc_pydantic",
    "sphinx_rtd_theme",
]
...
html_theme = "sphinx_rtd_theme"

autoapi_type = "python"
autoapi_dirs = ["../src"]
autoapi_keep_files = True
autoapi_python_class_content = 'both'
autoapi_options = ['members', 'undoc-members', 'show-inheritance', 'show-module-summary', 'special-members', 'imported-members']
@mansenfranzen mansenfranzen changed the title Noob question: Does this work with autoapi? Does autodoc_pydantic work with autoapi? Sep 30, 2022
@mansenfranzen
Copy link
Owner

@csm10495 Thanks for raising this question here. It is a very valid question and unfortunately this has not been covered in the docs.

The short answer is: No.

I added a section in the user's FAQ in the current dev release, see here. Please let me know if the FAQ answers your question. Also, feel free to drop any comment or alike.

@mansenfranzen mansenfranzen added the documentation Improvements or additions to documentation label Sep 30, 2022
@mansenfranzen mansenfranzen self-assigned this Sep 30, 2022
@csm10495
Copy link
Author

Thanks for the info!

@mansenfranzen
Copy link
Owner

@all-contributors please add @csm10495 for question

@allcontributors
Copy link
Contributor

@mansenfranzen

@csm10495 already contributed before to question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants