python-scim / scim2-models

SCIM resources serialization and validation with Pydantic
https://scim2-models.readthedocs.io
Apache License 2.0
11 stars 3 forks source link

Validate on assignment #54

Closed azmeuk closed 3 months ago

azmeuk commented 4 months ago

It could make sense to enable the validate_assignment pydantic option, but in the current state this breaks the codebase.

The cause of this is that the Resource type parameter used for extensions is also implied for extensions, leading for instance to EnterpriseUser to be expected to be an extension of itself.

E           pydantic_core._pydantic_core.ValidationError: 1 validation error for User[EnterpriseUser]
E           EnterpriseUser
E             Input should be a valid dictionary or instance of EnterpriseUser[EnterpriseUser] [type=model_type, input_value=EnterpriseUser(schemas=['...play_name='John Smith')), input_type=EnterpriseUser]
E               For further information visit https://errors.pydantic.dev/2.8/v/model_type

May depend on a resolution on pydantic side: https://github.com/pydantic/pydantic/issues/9858