chalk-ai / pydantic-scim

Apache License 2.0
2 stars 1 forks source link

`EnterpriseUser` `NameError` with pydantic 2.1.0 #9

Closed azmeuk closed 6 months ago

azmeuk commented 6 months ago

The EnterpriseUser._ref attributes is not compatible with pydantic 2.1.0

>>> from pydanticscim.enterprise_user import EnterpriseUser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/eloi/dev/pydantic-scim/pydanticscim/enterprise_user.py", line 6, in <module>
    class Manager(BaseModel):
  File "/home/eloi/.virtualenvs/pydantic-scim-vwax/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 93, in __new__
    private_attributes = inspect_namespace(
                         ^^^^^^^^^^^^^^^^^^
  File "/home/eloi/.virtualenvs/pydantic-scim-vwax/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 381, in inspect_namespace
    raise NameError(
NameError: Fields must not use names with leading underscores; e.g., use 'ref' instead of '_ref'.

Staying under 2.1.0 solves the issue.