For some reason, I am unable to pass a parameter and I get the following error, however, if I were to remove the string, everything behaves properly. If anyone else has come across a such an error please let me know how to resolve it!
This is what my API looks like:
@router.post("/post")
async def post_request(
db: Session = Depends(database.get_db(string_here="string")
):
return ...
and a database file with
def get_db(string_here: str):
.... returns a db
ERROR:
raise TypeError('{!r} is not a callable object'.format(obj))
TypeError: <generator object get_db at 0x000001FCFD7A8900> is not a callable object