Choose the most suitable documentation format based on context to maximize readability and information value.
For Pydantic models:
Example:
class Item(BaseModel):
"""Description of the model.
This allows more formatting than field descriptions like
newlines, *emphasis*.
"""
id: str = Field(
title="Short title of the field",
description="Longer description what the field is used for.\n\nUse line breaks for readability.",
)
This approach provides consistent and well-structured documentation that’s readable both in source code and in generated API documentation.
Enter the URL of a public GitHub repository