-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
22 lines (15 loc) · 664 Bytes
/
Copy pathmodels.py
File metadata and controls
22 lines (15 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from pydantic import BaseModel, Field
class User(BaseModel):
id: int = Field(..., example=1)
name: str = Field(..., example="John Doe")
phone_no: str = Field(..., example="1234567890")
address: str = Field(..., example="123 Main St")
class UserCreate(BaseModel):
id: int = Field(..., example=1)
name: str = Field(..., example="John Doe")
phone_no: str = Field(..., example="1234567890")
address: str = Field(..., example="123 Main St")
class UserUpdate(BaseModel):
name: str = Field(..., example="John Updated")
phone_no: str = Field(..., example="9876543210")
address: str = Field(..., example="456 Updated St")