Skip to content

In class UserResponse email field is mandatory, but it can be empty which leads to model validation failure #206

@sergey-ganchuk

Description

@sergey-ganchuk

Describe the bug
There are some users that having empty email field
When trying to get those users UserResponse object fails to validate because email is mandatory

To Reproduce
Find user with no email set
try to get it:

artifactory.users.get(user.name)

Expected behavior
it shouldn't fail model validation

python -c "import pyartifactory; print(pyartifactory.version)"
2.7.1

 - Python version, get it with:

python --version

Python 3.8.10

**Additional context**
class UserResponse(BaseUserModel):
    """Models a user response."""

    email: **Optional[EmailStr]** EmailStr
    lastLoggedIn: Optional[datetime] = None
    realm: Optional[str] = None
    offlineMode: bool = False

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions