Skip to content

Commit cb5abaf

Browse files
committed
updated to auto docs pydantic
1 parent d5cce50 commit cb5abaf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

docs/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
# Use this for generating API docs
3434
"sphinx.ext.autodoc",
3535
# This can parse google style docstrings
36+
"sphinxcontrib.autodoc_pydantic",
37+
# Used for BaseModel autodoc
3638
"sphinx.ext.napoleon",
3739
# For linking to external sphinx documentation
3840
"sphinx.ext.intersphinx",
@@ -84,6 +86,10 @@
8486
("py:class", "starlette.responses.JSONResponse"),
8587
]
8688

89+
# pydantic models
90+
autodoc_pydantic_model_show_json = True
91+
autodoc_pydantic_model_show_config_summary = False
92+
8793
# Both the class’ and the __init__ method’s docstring are concatenated and
8894
# inserted into the main body of the autoclass directive
8995
autoclass_content = "both"

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dev = [
4242
"pytest-cov",
4343
"ruff",
4444
"sphinx-autobuild",
45+
"autodoc-pydantic",
4546
"sphinx-copybutton",
4647
"sphinx-design",
4748
"sphinxcontrib-openapi",

0 commit comments

Comments
 (0)