get_field_docstrings
FunctionSource
v_1: dict[str, str | None] = get_field_docstrings(model_cls: type[Any], include_dyn_assign: bool = False)
Capture the docstrings of each assignment item in a class by its source code.
Arguments
Requires
| Name | Type | Required | |
|---|---|---|---|
model_cls | type[Any] | The class to be analyzed. | |
include_dyn_assign | bool | By default, this method will only detect the docstrings of such items: If this flag is enabled, will also detect docstrings of such items: |
Returns
| Name | Type | |
|---|---|---|
v_1 | dict[str, str | None] | The docstrings of the fields. If the value of a key is None, it means that this field does not have the docstring. |