FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
My-Python-Code/fastapi-main.py at main · aminzayer/My-Python-Code · GitHub
aminzayer
/
My-Python-Code
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
3
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
My-Python-Code
/
fastapi-main.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (12 loc) · 359 Bytes
Breadcrumbs
My-Python-Code
/
fastapi-main.py
Copy path
File metadata and controls
19 lines (12 loc) · 359 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from
typing
import
Optional
from
fastapi
import
FastAPI
from
pydantic
import
BaseModel
class
Item
(
BaseModel
):
name
:
str
description
:
Optional
[
str
]
=
None
price
:
float
tax
:
Optional
[
float
]
=
None
app
=
FastAPI
()
@
app
.
put
(
"/items/{item_id}"
)
async
def
create_item
(
item_id
:
int
,
item
:
Item
):
return
{
"item_id"
:
item_id
,
**
item
.
dict
()}
Back
|
FazBrowse Home
|
New Git URL