@@ -174,18 +174,12 @@ def __class_getitem__(cls, item: Any) -> type["Resource"]:
174174 f"{ cls .__name__ } [{ ', ' .join (ext .__name__ for ext in valid_extensions )} ]"
175175 )
176176
177- class_attrs = {
178- "__scim_extension_metadata__" : {
179- "args" : (item ,),
180- "origin" : cls ,
181- "extensions" : valid_extensions ,
182- }
183- }
177+ class_attrs = {"__scim_extension_metadata__" : valid_extensions }
184178
185179 for extension in valid_extensions :
186180 schema = extension .model_fields ["schemas" ].default [0 ]
187181 class_attrs [extension .__name__ ] = Field (
188- None ,
182+ default = None , # type: ignore[arg-type]
189183 serialization_alias = schema ,
190184 validation_alias = normalize_attribute_name (schema ),
191185 )
@@ -424,6 +418,10 @@ def model_attribute_to_scim_attribute(
424418
425419 field_info = model .model_fields [attribute_name ]
426420 root_type = model .get_field_root_type (attribute_name )
421+ if root_type is None :
422+ raise ValueError (
423+ f"Could not determine root type for attribute { attribute_name } "
424+ )
427425 attribute_type = Attribute .Type .from_python (root_type )
428426 sub_attributes = (
429427 [
@@ -443,7 +441,7 @@ def model_attribute_to_scim_attribute(
443441
444442 return Attribute (
445443 name = field_info .serialization_alias or attribute_name ,
446- type = attribute_type ,
444+ type = Attribute . Type ( attribute_type ) ,
447445 multi_valued = model .get_field_multiplicity (attribute_name ),
448446 description = field_info .description ,
449447 canonical_values = field_info .examples ,
0 commit comments