I am new to FastAPI & I am getting this error.
Can anyone help
1
fastapi.exceptions.FastAPIError: Invalid args for response field! Hint: check that <class 'main.Product'> is a valid Pydantic field type. If you are using a return type annotation that is not a valid Pydantic field (e.g. Union[Response, dict, None]) you can disable generating the response model from the type annotation with the path operation decorator parameter response_model=None. Read more: fastapi.tiangolo.com/tutorial/response-model
`
Very nice article. On your code for create_author, should you explain why to create a new Author object from the old one - why can't use the Author object that was passed. Thank you
Aditya Rajbhar
A passionate Software Engineer from India.
I am new to FastAPI & I am getting this error. Can anyone help
1 fastapi.exceptions.FastAPIError: Invalid args for response field! Hint: check that <class 'main.Product'> is a valid Pydantic field type. If you are using a return type annotation that is not a valid Pydantic field (e.g. Union[Response, dict, None]) you can disable generating the response model from the type annotation with the path operation decorator parameter response_model=None. Read more: fastapi.tiangolo.com/tutorial/response-model `