We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c0fedb commit dd3e039Copy full SHA for dd3e039
1 file changed
scim2_server/utils.py
@@ -1,6 +1,7 @@
1
import datetime
2
import importlib
3
import json
4
+from types import UnionType
5
from typing import Any
6
from typing import Union
7
from typing import get_args
@@ -102,7 +103,7 @@ def is_multi_valued(model: BaseModel, attribute_name: str) -> bool:
102
103
"""Checks whether a given attribute of a model is multi-valued."""
104
attribute_type = model.model_fields[attribute_name].annotation
105
- if get_origin(attribute_type) is Union:
106
+ if get_origin(attribute_type) in (Union, UnionType):
107
attribute_type = get_args(attribute_type)[0]
108
109
origin = get_origin(attribute_type)
0 commit comments