scim2-models supports defining multi-valued primitive fields on extensions (e.g., list[str] | None), and the tutorial documents this as valid. However, scim2-server's PATCH operators crash when processing these fields because parse_new_value and model_validate_from_dict assume the field's root type is always a BaseModel subclass.
Reproduction:
Define an extension with a multi-valued primitive:
classMyExtension(Extension):
tags: list[str] |None=None
PATCH replace with a list of strings:
{ "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations": [ {
"op": "replace", "path": "urn:example:schemas:MyExtension:tags", "value": ["tag1", "tag2"] }
] } Result: 400 invalidValue
scim2-models supports defining multi-valued primitive fields on extensions (e.g., list[str] | None), and the tutorial documents this as valid. However, scim2-server's PATCH operators crash when processing these fields because parse_new_value and model_validate_from_dict assume the field's root type is always a BaseModel subclass.
Reproduction:
Define an extension with a multi-valued primitive:
PATCH replace with a list of strings:
{ "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"], "Operations": [ { "op": "replace", "path": "urn:example:schemas:MyExtension:tags", "value": ["tag1", "tag2"] } ] }Result: 400 invalidValue