-
-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Is your feature request related to a problem? Please describe.
A pydantic.BaseModel field can have a title in addition to description. Currently the description is properly shown in the model documentation, but the title is not included at all.
Describe the solution you'd like
Include the field title in addition to the description in the model documentation.
The question is then how to combine the title and description in the documentation. Maybe separate these by a newline or a period, or make it configurable.
Describe alternatives you've considered
If there's a good reason to not show the title, a warning should be emitted whenever a pydantic.BaseModel has titles in its fields.
Additional context
The griffe-pydantic documentation example works as a good example. Just add a title to any of the fields to see how it is currently ignored.
By glancing at the code, it seems that the relevant function is griffe_pydantic._internal.dynamic._process_attribute and more concretely the docstring population at the end of that function.