Skip to content

Commit

Permalink
fix: NameError issue with Manager._ref
Browse files Browse the repository at this point in the history
Since pydantic 2.1, private attributes are not supported anymore.

This fixes this exception:

    NameError: Fields must not use names with leading underscores; e.g., use 'ref' instead of '_ref'.
  • Loading branch information
azmeuk committed May 23, 2024
1 parent 0dba24b commit 6651f9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pydantic_scim2/enterprise_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Manager(BaseModel):
None,
description="The id of the SCIM resource representingthe User's manager. REQUIRED.",
)
_ref: Optional[AnyUrl] = Field(
ref: Optional[AnyUrl] = Field(
None,
alias="$ref",
description="The URI of the SCIM resource representing the User's manager. REQUIRED.",
Expand Down
3 changes: 1 addition & 2 deletions tests/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_user_response(minimal_user_payload):

@pytest.mark.skip
def test_enterprise_user_response(enterprise_user_payload):
from pydantic_scim.enterprise_user import EnterpriseUser
from pydantic_scim2.enterprise_user import EnterpriseUser

payload = {
"totalResults": 1,
Expand Down Expand Up @@ -65,7 +65,6 @@ def test_service_provider_configuration_response(
assert isinstance(obj, ServiceProviderConfiguration)


@pytest.mark.skip
def test_resource_type_response(resource_type_payload):
payload = {
"totalResults": 2,
Expand Down

0 comments on commit 6651f9f

Please sign in to comment.