Skip to content

Commit 3ab5a3b

Browse files
committed
refactor: remove deprecated example field
1 parent 3ff2140 commit 3ab5a3b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

api/src/features/todo/use_cases/add_todo.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,23 @@ class AddTodoRequest(BaseModel):
1111
title="The title of the item",
1212
max_length=300,
1313
min_length=1,
14-
example="Read about clean architecture",
14+
json_schema_extra={
15+
"examples": ["Read about clean architecture"],
16+
},
1517
)
1618

1719

1820
class AddTodoResponse(BaseModel):
19-
id: str = Field(example="vytxeTZskVKR7C7WgdSP3d")
20-
title: str = Field(example="Read about clean architecture")
21+
id: str = Field(
22+
json_schema_extra={
23+
"examples": ["vytxeTZskVKR7C7WgdSP3d"],
24+
}
25+
)
26+
title: str = Field(
27+
json_schema_extra={
28+
"examples": ["Read about clean architecture"],
29+
}
30+
)
2131
is_completed: bool = False
2232

2333
@staticmethod

0 commit comments

Comments
 (0)