pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
357 B
14 lines
357 B
from typing import List, Set
|
|
|
|
from fastapi import Body, FastAPI, Path, Query
|
|
from pydantic import BaseModel
|
|
from pydantic.types import UrlStr
|
|
from starlette.status import HTTP_201_CREATED
|
|
from starlette.responses import UJSONResponse
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/items/", content_type=UJSONResponse)
|
|
async def read_items():
|
|
return [{"item_id": "Foo"}]
|
|
|