scim2-models icon indicating copy to clipboard operation
scim2-models copied to clipboard

Allow extra fields from clients

Open ryanfaircloth opened this issue 1 year ago • 5 comments

https://github.com/python-scim/scim2-models/blob/00031eb0a4fa41c6f57631600021bf3019351976/scim2_models/base.py#L413

For server implementations clients often send fields not permitted or defined in the model This is unfortunate however for compatibility we need to allow but ignore fields we don't support

ryanfaircloth avatar Nov 27 '24 17:11 ryanfaircloth

Interesting. In the end, depending on the context, one might want the extra param to be lax (for servers or clients analyzing incoming data) or to be strict (when servers or clients produce data to be sent, or for compliance testers). I wonder if Pydantic would allow this parameter to be dynamic.

azmeuk avatar Nov 28 '24 08:11 azmeuk

I opened a ticket upstream. https://github.com/pydantic/pydantic/issues/11057

azmeuk avatar Dec 06 '24 09:12 azmeuk

Any ideas for how to workaround this issue in the meantime? We are bumping into the same issue (we are getting close to actually releasing our SCIM feature for GA and our testing with different IDPs)

vpatov avatar Sep 11 '25 17:09 vpatov

For the record, there are PRs tackling this at Pydantic. I guess on the short term a convenient thing would be to set the behavior with an environment var, but I fear to introduce hotfixes like this, then rework the whole thing on sane basis and break compatibility

azmeuk avatar Sep 11 '25 19:09 azmeuk

It looks like this is possible to add an extra parameter during validation with Pydantic 2.12

https://docs.pydantic.dev/2.12/concepts/models/#extra-data

@ryanfaircloth @vpatov can you confirm this is a solution for you?

azmeuk avatar Oct 10 '25 08:10 azmeuk