Skip to content

Commit f01878f

Browse files
committed
Update: modify 1 file(s)
1 parent 4c0aa13 commit f01878f

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/stickler/structured_object_evaluator/models/structured_model.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,8 @@ def _is_list_of_structured_model_type(cls, field_type) -> bool:
252252
if origin is list or origin is List:
253253
args = get_args(field_type)
254254
if args:
255-
element_type = args[0]
256-
# Check if element type is a StructuredModel subclass
257-
try:
258-
return inspect.isclass(element_type) and issubclass(
259-
element_type, StructuredModel
260-
)
261-
except (TypeError, AttributeError):
262-
return False
255+
# Use consolidated method for element type check
256+
return cls._is_structured_model_type(args[0])
263257

264258
# Handle Union types (like Optional[List[StructuredModel]])
265259
elif origin is Union:

0 commit comments

Comments
 (0)