From f03df25bafd5d0432005dd9bb8e537d843cc533b Mon Sep 17 00:00:00 2001 From: Matteo Ruggiero <72571992+mRuggi@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:29:48 +0000 Subject: [PATCH 1/3] fix: group display_name should be required --- scim2_models/resources/group.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scim2_models/resources/group.py b/scim2_models/resources/group.py index d520aab..1413037 100644 --- a/scim2_models/resources/group.py +++ b/scim2_models/resources/group.py @@ -6,6 +6,7 @@ from pydantic import Field +from ..annotations import Required from ..annotations import Mutability from ..attributes import ComplexAttribute from ..path import URN @@ -38,7 +39,7 @@ class GroupMember(ComplexAttribute): class Group(Resource[Any]): __schema__ = URN("urn:ietf:params:scim:schemas:core:2.0:Group") - display_name: str | None = None + display_name: Annotated[str | None, Required.true] = None """A human-readable name for the Group.""" members: list[GroupMember] | None = None From 17c6399b36cb0a0f8fb8c8023a80b465d85ac84d Mon Sep 17 00:00:00 2001 From: Matteo Ruggiero <72571992+mRuggi@users.noreply.github.com> Date: Thu, 29 Jan 2026 20:16:37 +0100 Subject: [PATCH 2/3] Update rfc7643-8.7.1-schema-group.json --- samples/rfc7643-8.7.1-schema-group.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/rfc7643-8.7.1-schema-group.json b/samples/rfc7643-8.7.1-schema-group.json index bc564b4..6ac48e0 100644 --- a/samples/rfc7643-8.7.1-schema-group.json +++ b/samples/rfc7643-8.7.1-schema-group.json @@ -9,7 +9,7 @@ "type": "string", "multiValued": false, "description": "A human-readable name for the Group. REQUIRED.", - "required": false, + "required": true, "caseExact": false, "mutability": "readWrite", "returned": "default", From 9669f8ecbe78b0a5a536e6b4bd86af091b7e5a9a Mon Sep 17 00:00:00 2001 From: Matteo Ruggiero Date: Thu, 29 Jan 2026 21:04:05 +0100 Subject: [PATCH 3/3] fix: unit tests and style checks --- scim2_models/resources/group.py | 2 +- tests/test_dynamic_resources.py | 4 ++-- tests/test_schema.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scim2_models/resources/group.py b/scim2_models/resources/group.py index 1413037..fd3cfe1 100644 --- a/scim2_models/resources/group.py +++ b/scim2_models/resources/group.py @@ -6,8 +6,8 @@ from pydantic import Field -from ..annotations import Required from ..annotations import Mutability +from ..annotations import Required from ..attributes import ComplexAttribute from ..path import URN from ..reference import Reference diff --git a/tests/test_dynamic_resources.py b/tests/test_dynamic_resources.py index 9fd55b0..4fb649d 100644 --- a/tests/test_dynamic_resources.py +++ b/tests/test_dynamic_resources.py @@ -32,7 +32,7 @@ def test_make_group_model_from_schema(load_sample): Group.model_fields["display_name"].description == "A human-readable name for the Group. REQUIRED." ) - assert Group.get_field_annotation("display_name", Required) == Required.false + assert Group.get_field_annotation("display_name", Required) == Required.true assert Group.get_field_annotation("display_name", CaseExact) == CaseExact.false assert ( Group.get_field_annotation("display_name", Mutability) == Mutability.read_write @@ -2712,7 +2712,7 @@ def test_make_schema_model_from_schema(load_sample): assert obj.attributes[0].description == ( "A human-readable name for the Group. REQUIRED." ) - assert not obj.attributes[0].required + assert obj.attributes[0].required assert not obj.attributes[0].case_exact assert obj.attributes[0].mutability == Mutability.read_write assert obj.attributes[0].returned == Returned.default diff --git a/tests/test_schema.py b/tests/test_schema.py index c15f9a9..4c8ac6f 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -21,7 +21,7 @@ def test_group_schema(load_sample): assert obj.attributes[0].description == ( "A human-readable name for the Group. REQUIRED." ) - assert not obj.attributes[0].required + assert obj.attributes[0].required assert not obj.attributes[0].case_exact assert obj.attributes[0].mutability == Mutability.read_write assert obj.attributes[0].returned == Returned.default