Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis save gives me error #553

Closed
PARKER-X opened this issue Aug 12, 2023 · 4 comments
Closed

redis save gives me error #553

PARKER-X opened this issue Aug 12, 2023 · 4 comments

Comments

@PARKER-X
Copy link

@app.post("/products")
def create(product: Product):

return product.save()

raise fastapi.exceptions.FastAPIError(

fastapi.exceptions.FastAPIError: Invalid args for response field! Hint: check that <class 'inventory.schema.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: https://fastapi.tiangolo.com/tutorial/response-model/

@PARKER-X
Copy link
Author

Can anyone help me

@XChikuX
Copy link

XChikuX commented Aug 19, 2023

Product.save() returns either none, boolean or some integer value, to indicate it saved correctly on redis.

You probably want to return something after Product.get()

As far as I can tell, is not a redis-om issue.

@ggozad
Copy link

ggozad commented Sep 22, 2023

@XChikuX This is not irrelevant to redis-om. It's the same issue as in #546 & #539.
Basically redis-om is not compatible with Pydantic>2. Works fine with pydantic<2.

@PARKER-X
Copy link
Author

@XChikuX Yeah man it's work for pydantic <2
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants