Skip to content

Pydantic validation error when calling user.get #826

@jamesstottmoj

Description

@jamesstottmoj

Checklist

  • I have looked into the Readme and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

I am getting a validation error when calling users.get(). My ID is linked to github and the identities block seems to split out the provider and the ID. The ID is stored as an int and is falling foul of pydantic's validation

1 validation error for GetUserResponseContent
identities.0.user_id
  Input should be a valid string [type=string_type, input_value=123456789, input_type=int]

I think this is because GetUserResponseContent is using UserIdentitySchema to store identities and user_id is expected to be a string. I believe the screen below is capturing where the issue is happening.

Image

Reproduction

  1. Attempt to get a user with a github identity - client.users.get(id="github|123456789")
  2. Get a validation error

Additional context

No response

auth0-python version

5.2.0

Python version

3.12.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions