Pydantic V2 (Sanjeev's Python API development)

So I’ve been coding along with Sanjeev’s Python API development and I’m stuck on hour 5 because the Fast API package has started using Pydantic V2.

My issue is the code below is causing errors.

class Post(PostBase):
    title: str
    content: str
    published: bool

    class Config:
        orm_mode = True

I googled the errors and I found out that it’s because changes were made to Pydantic. Pls, I’m a beginner and documentations still overwhelm me. What is the simple solution to my plight?

I’ve solved my issue. The issue was that I forgot to remove the async property from all my path functions. I guess I wasn’t following along properly.

nope that wasn’t the answer the same errors are happening because of this:

class UserOut(BaseModel):
    id: int
    email: EmailStr

    class Config:
        orm_mode = True

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.