Closed eduard-sukharev closed 3 years ago
from pydantic import BaseModel, Field
class Task(BaseModel):
id: str = Field(title="my title")
type: str
on_success: Optional[str] # ID for task to run on success
on_error: Optional[str] # ID for task to run on failure
You can find more details here:
https://pydantic-docs.helpmanual.io/usage/schema/#field-customisation
I have a model:
And in a Swagger UI (OAS) I get following model description:
What I want is to somehow define the title in pydantic model so that it's not plainly repeat the field itself. How do I do that?