sql_app/schema: fix type error

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2022-04-03 14:54:16 +03:00
parent 64edc98a76
commit 98c3f5416a

View File

@ -4,6 +4,9 @@ from sqlalchemy.orm import Session
from . import crud, models, schemas
from .database import SessionLocal, engine
from typing import List
models.Base.metadata.create_all(bind=engine)
app = FastAPI()
@ -26,7 +29,7 @@ def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)):
return crud.create_user(db=db, user=user)
@app.get("/users/", response_model=list[schemas.User])
@app.get("/users/", response_model=List[schemas.User])
def read_users(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)):
users = crud.get_users(db, skip=skip, limit=limit)
return users