scim2-models 0.3.4__py3-none-any.whl → 0.3.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,7 @@ from ..base import BaseModelType
17
17
  from ..base import CaseExact
18
18
  from ..base import ComplexAttribute
19
19
  from ..base import ExternalReference
20
+ from ..base import MultiValuedComplexAttribute
20
21
  from ..base import Mutability
21
22
  from ..base import Required
22
23
  from ..base import Returned
@@ -253,8 +254,8 @@ class Resource(BaseModel, Generic[AnyExtension], metaclass=ResourceMetaclass):
253
254
  AnyResource = TypeVar("AnyResource", bound="Resource")
254
255
 
255
256
 
256
- def dedicated_attributes(model):
257
- """Return attributes that are not members of parent classes."""
257
+ def dedicated_attributes(model, excluded_models):
258
+ """Return attributes that are not members the parent 'excluded_models'."""
258
259
 
259
260
  def compare_field_infos(fi1, fi2):
260
261
  return (
@@ -268,8 +269,8 @@ def dedicated_attributes(model):
268
269
 
269
270
  parent_field_infos = {
270
271
  field_name: field_info
271
- for parent in model.__bases__
272
- for field_name, field_info in parent.model_fields.items()
272
+ for excluded_model in excluded_models
273
+ for field_name, field_info in excluded_model.model_fields.items()
273
274
  }
274
275
  field_infos = {
275
276
  field_name: field_info
@@ -283,7 +284,7 @@ def model_to_schema(model: type[BaseModel]):
283
284
  from scim2_models.rfc7643.schema import Schema
284
285
 
285
286
  schema_urn = model.model_fields["schemas"].default[0]
286
- field_infos = dedicated_attributes(model)
287
+ field_infos = dedicated_attributes(model, [Resource])
287
288
  attributes = [
288
289
  model_attribute_to_attribute(model, attribute_name)
289
290
  for attribute_name in field_infos
@@ -323,7 +324,9 @@ def model_attribute_to_attribute(model, attribute_name):
323
324
  sub_attributes = (
324
325
  [
325
326
  model_attribute_to_attribute(root_type, sub_attribute_name)
326
- for sub_attribute_name in dedicated_attributes(root_type)
327
+ for sub_attribute_name in dedicated_attributes(
328
+ root_type, [MultiValuedComplexAttribute]
329
+ )
327
330
  if (
328
331
  attribute_name != "sub_attributes"
329
332
  or sub_attribute_name != "sub_attributes"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scim2-models
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: SCIM2 models serialization and validation with pydantic
5
5
  Project-URL: documentation, https://scim2-models.readthedocs.io
6
6
  Project-URL: repository, https://github.com/python-scim/scim2-models
@@ -6,7 +6,7 @@ scim2_models/utils.py,sha256=MzZz212-lkVWgXcpXvNwoi_u28wBTpkTwPrfYC5v92A,2771
6
6
  scim2_models/rfc7643/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  scim2_models/rfc7643/enterprise_user.py,sha256=EaxdHH2dcBrwWwGpaZC6iZ9dbcaVN1NpoRLAdkTYssQ,1781
8
8
  scim2_models/rfc7643/group.py,sha256=JML8OtgKjvHHv2YufiYcTtbZuN5GFVQTbm1J6MLtp8o,1427
9
- scim2_models/rfc7643/resource.py,sha256=zMyk02Traoq6XNBcS_fSnXIOadZwxTdA9CV4vLuy38k,12648
9
+ scim2_models/rfc7643/resource.py,sha256=PUWoajKewJuitaxVcClxfCucaSdkzIfphld-kK8KLdo,12812
10
10
  scim2_models/rfc7643/resource_type.py,sha256=p8IKV5IakPMBX6d2Fv2MFqaQL5iTw152vmozVVSC8gU,3196
11
11
  scim2_models/rfc7643/schema.py,sha256=B7TzMbT6ngYQrMqvqW5_LberN6EaqtZaFwBVsgoA3S0,10388
12
12
  scim2_models/rfc7643/service_provider_config.py,sha256=deMNCXlqiNzuLcVRN9mdHiTUxhczDnvi-oO6k-Anj8U,5402
@@ -18,7 +18,7 @@ scim2_models/rfc7644/list_response.py,sha256=ltjV1WII2fNy8j3RX8J0_Jb5DW4hTFoO6P-
18
18
  scim2_models/rfc7644/message.py,sha256=F4kPqbHAka3-wZzap9a45noQZw-o1vznTJypNABBF7w,253
19
19
  scim2_models/rfc7644/patch_op.py,sha256=OE-ixDanTkY5zQP7EK7OAp88uE_fMk03mqmaZHxgJ-g,2210
20
20
  scim2_models/rfc7644/search_request.py,sha256=DRGlixcWtYtbUuP9MT7PsnvyxlONLcXGEcQveWdqQng,3003
21
- scim2_models-0.3.4.dist-info/METADATA,sha256=K4xDCV3A2Hv7Wq-QiCoXrPU3XoDKFaeqAzTQL8aKybY,16288
22
- scim2_models-0.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
- scim2_models-0.3.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
24
- scim2_models-0.3.4.dist-info/RECORD,,
21
+ scim2_models-0.3.5.dist-info/METADATA,sha256=h7WtwUPjMOgw4iUIhqrfdmISInw8dDyOupVqu308vYg,16288
22
+ scim2_models-0.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ scim2_models-0.3.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
24
+ scim2_models-0.3.5.dist-info/RECORD,,