File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
3
4
+ [0.2.2] - Unreleased
5
+ --------------------
6
+
7
+ Fixed
8
+ ^^^^^
9
+ - :class: `~scim2_models.ListResponse ` pydantic discriminator issue introduced with pydantic 2.9.0. #75
10
+
4
11
[0.2.1] - 2024-09-06
5
12
--------------------
6
13
Original file line number Diff line number Diff line change @@ -39,14 +39,18 @@ def get_schema_from_payload(payload: Any) -> Optional[str]:
39
39
if not payload :
40
40
return None
41
41
42
+ payload_schemas = (
43
+ payload .get ("schemas" , [])
44
+ if isinstance (payload , dict )
45
+ else getattr (payload , "schemas" )
46
+ )
47
+
42
48
resource_types_schemas = [
43
49
resource_type .model_fields ["schemas" ].default [0 ]
44
50
for resource_type in resource_types
45
51
]
46
52
common_schemas = [
47
- schema
48
- for schema in payload .get ("schemas" , [])
49
- if schema in resource_types_schemas
53
+ schema for schema in payload_schemas if schema in resource_types_schemas
50
54
]
51
55
return common_schemas [0 ] if common_schemas else None
52
56
You can’t perform that action at this time.
0 commit comments