File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Changelog
22=========
33
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+
411[0.2.1] - 2024-09-06
512--------------------
613
Original file line number Diff line number Diff line change @@ -39,14 +39,18 @@ def get_schema_from_payload(payload: Any) -> Optional[str]:
3939 if not payload :
4040 return None
4141
42+ payload_schemas = (
43+ payload .get ("schemas" , [])
44+ if isinstance (payload , dict )
45+ else getattr (payload , "schemas" )
46+ )
47+
4248 resource_types_schemas = [
4349 resource_type .model_fields ["schemas" ].default [0 ]
4450 for resource_type in resource_types
4551 ]
4652 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
5054 ]
5155 return common_schemas [0 ] if common_schemas else None
5256
You can’t perform that action at this time.
0 commit comments