Get multiple items given an arbitrary query. I am trying to achieve this using Python Fastapi, this is what I did in routes,
def get_props_query(
*,
session: Session = Depends(get_session),
query: Optional[Props] = Query(
default=select(PropsTable), description="It is optional"
)):
but getting this error ->
raise fastapi.exceptions.FastAPIError(
fastapi.exceptions.FastAPIError: Invalid args for response field! Hint: check that typing.Optional
Created a model like this
from pydantic import BaseModel
class Props(BaseModel):
query: Optional[str]