Skip to content

[Fix] Allow testing resources with multiple extensions #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

J-Bu
Copy link

@J-Bu J-Bu commented Jun 11, 2025

If a server advertises a resource with multiple extensions scim2-client will fail with:

  File "/usr/local/lib/python3.11/site-packages/pydantic/_internal/_generics.py", line 373, in map_generic_model_arguments
    raise TypeError(f'Too many arguments for {cls}; actual {len(args)}, expected {expected_len}')
TypeError: Too many arguments for <class 'scim2_models.rfc7643.schema.User'>; actual 3, expected 1

The problem here is that a tuple is used as container for the Generic AnyExtension but it must be a Union to make pydantic happy. The scim2-models also checks if the type is a Union.

…nsion

Using a tuple results in a pydantic error:
  File "/usr/local/lib/python3.11/site-packages/pydantic/_internal/_generics.py", line 373, in map_generic_model_arguments
    raise TypeError(f'Too many arguments for {cls}; actual {len(args)}, expected {expected_len}')
TypeError: Too many arguments for <class 'scim2_models.rfc7643.schema.User'>; actual 3, expected 1
@azmeuk
Copy link
Contributor

azmeuk commented Jun 12, 2025

Thank you for your contribution.
Could you please add a unit test for this use case?

@J-Bu
Copy link
Author

J-Bu commented Jun 30, 2025

Sorry for the late response finally found the time to add a unit test.

@azmeuk
Copy link
Contributor

azmeuk commented Jul 2, 2025

Hi. It seems there are errors with Python > 3.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants