Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/rfc7643-8.7.1-schema-group.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion scim2_models/resources/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pydantic import Field

from ..annotations import Mutability
from ..annotations import Required
from ..attributes import ComplexAttribute
from ..path import URN
from ..reference import Reference
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_dynamic_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down