[Answered ]-Django Ninja API framework Pydantic schema for User model ommits fields

1👍

Looks like the problem is that you didn’t specify type for other fields. Just replace = with : in your schema for all fields:

class UserBase(Schema):
    """Base user schema for GET method."""

    id: int
    username: str # not =
    first_name: str
    last_name: str
    email: str

Leave a comment