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

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

Open
sergey-ganchuk opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sergey-ganchuk
Copy link

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

@sergey-ganchuk sergey-ganchuk added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant