You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the reference pages generate the documentation for Pydantic models from two different sources: from the Pydantic fields (via typing_extensions.Annotated and scripts/docs/gen_schema_reference.py - for YAML schema) and from docstrings (via mkdocstrings - for the Python API). This leads to having the documentation of the Pydantic fields duplicated.
Solution
Minimum: For Pydantic models that don't have methods, in Python API reference, switch to typing_extensions.Annotated via scripts/docs/gen_schema_reference.py. Remove the docstrings that are duplicated by typing_extensions.Annotated.
Switch to scripts/docs/gen_schema_reference.py for dstack.api.Task and dstack.api.Service, dstack.api.Resources, dstack.api.GPU, and dstack.api.Disk
Include the dostrings for the Pydantic class into the documentation generated by scripts/docs/gen_schema_reference.py
Implement a setting format: yaml|python for scripts/docs/gen_schema_reference.py (to use the table format, include type, examples link, etc)
Maximum: Switch from mkdocstrings to scripts/docs/gen_schema_reference.py entirely for Python API reference generation by adding generation of the documentation for methods to scripts/docs/gen_schema_reference.py.
The text was updated successfully, but these errors were encountered:
@pawamoy Thanks a lot for sharing this. Actually, I tried I suppose both but couldn't find a way to make them work. It simply didn't render any annotated fields.
Problem
Currently, the reference pages generate the documentation for Pydantic models from two different sources: from the Pydantic fields (via
typing_extensions.Annotated
andscripts/docs/gen_schema_reference.py
- for YAML schema) and from docstrings (viamkdocstrings
- for the Python API). This leads to having the documentation of the Pydantic fields duplicated.Solution
typing_extensions.Annotated
viascripts/docs/gen_schema_reference.py
. Remove the docstrings that are duplicated bytyping_extensions.Annotated
.scripts/docs/gen_schema_reference.py
fordstack.api.Task
anddstack.api.Service
,dstack.api.Resources
,dstack.api.GPU
, anddstack.api.Disk
scripts/docs/gen_schema_reference.py
format: yaml|python
forscripts/docs/gen_schema_reference.py
(to use the table format, include type, examples link, etc)mkdocstrings
toscripts/docs/gen_schema_reference.py
entirely for Python API reference generation by adding generation of the documentation for methods toscripts/docs/gen_schema_reference.py
.The text was updated successfully, but these errors were encountered: