From cb5abafb1a73f9fccb2acb887096b882673e328d Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh Date: Tue, 13 Aug 2024 10:30:17 +0100 Subject: [PATCH] updated to auto docs pydantic --- docs/conf.py | 6 ++++++ pyproject.toml | 1 + 2 files changed, 7 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 33b043e4..d0a4cc19 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,6 +33,8 @@ # Use this for generating API docs "sphinx.ext.autodoc", # This can parse google style docstrings + "sphinxcontrib.autodoc_pydantic", + # Used for BaseModel autodoc "sphinx.ext.napoleon", # For linking to external sphinx documentation "sphinx.ext.intersphinx", @@ -84,6 +86,10 @@ ("py:class", "starlette.responses.JSONResponse"), ] +# pydantic models +autodoc_pydantic_model_show_json = True +autodoc_pydantic_model_show_config_summary = False + # Both the class’ and the __init__ method’s docstring are concatenated and # inserted into the main body of the autoclass directive autoclass_content = "both" diff --git a/pyproject.toml b/pyproject.toml index e8e6bf18..cdb3e927 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ dev = [ "pytest-cov", "ruff", "sphinx-autobuild", + "autodoc-pydantic", "sphinx-copybutton", "sphinx-design", "sphinxcontrib-openapi",