Closed ccoors closed 1 week ago
mark_with_schema
is a simple way to give a URN to sub-attributes, so they can be included or excluded with the model_dump
attributes
or excluded_attributes
parameters. Attributes are marked at validation time, but as pydantic validate_assignment is not enabled, user.meta = Meta(...)
does not validate the model and mark_with_schema
is not called. I am not satisfied with how this is implemented now (hence #42) and I think validate_assignment
could be enabled by default, but it breaks the tests at the moment.
If I leave out the scim_ctx, it works correctly without calling user.mark_with_schema().
Yes, I guess most of the unit test does not use the scim_ctx
attribute, because most of them were written before the Context
implementation, so in the end they may not really test real world use cases.
Hi,
I have found that modifying a
Resource
can lead to serialization issues when creating complex attributes:This fails with
If I call
before the
model_dump
call, serialization works. Is this intentional? If I leave out thescim_ctx
, it works correctly without callinguser.mark_with_schema()
.