Vaibhav84 commited on
Commit
e30c82e
·
1 Parent(s): 3ea7261
Files changed (1) hide show
  1. app.py +17 -11
app.py CHANGED
@@ -128,14 +128,20 @@ def ExtractSkills(skill_data: SkillDetails):
128
 
129
  from datetime import datetime
130
  from typing import Union
131
- class Item(BaseModel):
132
- title: str ='Test'
133
- description: str = 'Desc'
134
-
135
- @app.post("/getProfileMatchResultsByName/{id}")
136
- def getProfileMatchResultsByName(id: str):
137
- item: Item
138
- item.title ='test'
139
- item.description = 'desc'
140
- json_compatible_item_data = jsonable_encoder(item)
141
- return JSONResponse(content=json_compatible_item_data)
 
 
 
 
 
 
 
128
 
129
  from datetime import datetime
130
  from typing import Union
131
+ from typing import Any, Union
132
+ from pydantic import BaseModel, EmailStr
133
+ class UserIn(BaseModel):
134
+ username: str
135
+ password: str
136
+ email: EmailStr
137
+ full_name: Union[str, None] = None
138
+
139
+
140
+ class UserOut(BaseModel):
141
+ username: str
142
+ email: EmailStr
143
+ full_name: Union[str, None] = None
144
+
145
+ @app.post("/user/", response_model=UserOut)
146
+ async def create_user(user: UserIn) -> Any:
147
+ return user