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

pydantic=true is not effective #9442

Open
yuanjie-ai opened this issue Nov 29, 2024 · 5 comments
Open

pydantic=true is not effective #9442

yuanjie-ai opened this issue Nov 29, 2024 · 5 comments

Comments

@yuanjie-ai
Copy link

TypeError: Object of type Request is not JSON serializable

During handling of the above exception, another exception occurred:

@yuanjie-ai
Copy link
Author

class Request(BaseModel):
    method: str = "GET"
    url: str = "https://api.chatfire.cn/"

    class Config:
        frozen = True
@shared_task(pydantic=True)
def do_pydantic_task(request: Request) -> Request:
    logger.debug(request)
    return request

Uploading image.png…

@yuanjie-ai
Copy link
Author

image

@yuanjie-ai
Copy link
Author

It should be a Basemodel, but it's still a dictionary inside

@Nusnus
Copy link
Member

Nusnus commented Nov 29, 2024

@mathiasertl

@mathiasertl
Copy link
Contributor

Are you sure you're using the latest beta release?

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

No branches or pull requests

3 participants