amsdal_utils 0.5.0__py3-none-any.whl → 0.5.2__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.
- amsdal_utils/__about__.py +1 -1
- amsdal_utils/models/data_models/core.py +3 -1
- amsdal_utils/schemas/schema.py +7 -5
- {amsdal_utils-0.5.0.dist-info → amsdal_utils-0.5.2.dist-info}/METADATA +1 -1
- {amsdal_utils-0.5.0.dist-info → amsdal_utils-0.5.2.dist-info}/RECORD +7 -7
- {amsdal_utils-0.5.0.dist-info → amsdal_utils-0.5.2.dist-info}/WHEEL +0 -0
- {amsdal_utils-0.5.0.dist-info → amsdal_utils-0.5.2.dist-info}/licenses/LICENSE.txt +0 -0
amsdal_utils/__about__.py
CHANGED
|
@@ -91,6 +91,8 @@ def process_one_of(data: dict[str, Any]) -> dict[str, Any]:
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
def process_any_of(data: dict[str, Any], info: ValidationInfo) -> dict[str, Any]:
|
|
94
|
+
from amsdal_utils.schemas.schema import PropertyData
|
|
95
|
+
|
|
94
96
|
_any_of = data.pop('anyOf')
|
|
95
97
|
if _any_of in [[{'$ref': '#/$defs/Reference'}], [{'$ref': '#/$defs/Reference'}, {'type': 'null'}]]:
|
|
96
98
|
data['type'] = 'object'
|
|
@@ -138,7 +140,7 @@ def process_any_of(data: dict[str, Any], info: ValidationInfo) -> dict[str, Any]
|
|
|
138
140
|
if 'items' not in data:
|
|
139
141
|
data['items'] = DictSchema(
|
|
140
142
|
key=TypeData(type='string'),
|
|
141
|
-
value=TypeData(
|
|
143
|
+
value=TypeData(**PropertyData._format_openapi_parameters(_add_props, info)),
|
|
142
144
|
)
|
|
143
145
|
|
|
144
146
|
if _any_of_element['type'] == 'object':
|
amsdal_utils/schemas/schema.py
CHANGED
|
@@ -39,9 +39,8 @@ class PropertyData(TypeData, extra='allow'):
|
|
|
39
39
|
is_deleted: bool = False
|
|
40
40
|
discriminator: str | None = None
|
|
41
41
|
|
|
42
|
-
@model_validator(mode='before')
|
|
43
42
|
@classmethod
|
|
44
|
-
def
|
|
43
|
+
def _format_openapi_parameters(cls, data: dict[str, Any], info: ValidationInfo) -> dict[str, Any]:
|
|
45
44
|
if '$ref' in data:
|
|
46
45
|
if not info.context:
|
|
47
46
|
msg = 'Context is required to resolve $ref'
|
|
@@ -58,11 +57,9 @@ class PropertyData(TypeData, extra='allow'):
|
|
|
58
57
|
if 'anyOf' in _add_props:
|
|
59
58
|
_add_props = process_any_of(_add_props, info)
|
|
60
59
|
|
|
61
|
-
_type = _add_props.get('type', 'object')
|
|
62
|
-
|
|
63
60
|
items = DictSchema(
|
|
64
61
|
key=TypeData(type='string'),
|
|
65
|
-
value=TypeData(
|
|
62
|
+
value=TypeData(**cls._format_openapi_parameters(_add_props, info)),
|
|
66
63
|
)
|
|
67
64
|
|
|
68
65
|
if 'items' not in data:
|
|
@@ -73,6 +70,11 @@ class PropertyData(TypeData, extra='allow'):
|
|
|
73
70
|
|
|
74
71
|
return {CLASS_OPENAPI_PARAMETERS_MAPPER.get(k, k): v for k, v in data.items()}
|
|
75
72
|
|
|
73
|
+
@model_validator(mode='before')
|
|
74
|
+
@classmethod
|
|
75
|
+
def format_openapi_parameters(cls, data: dict[str, Any], info: ValidationInfo) -> dict[str, Any]:
|
|
76
|
+
return cls._format_openapi_parameters(data, info)
|
|
77
|
+
|
|
76
78
|
@model_validator(mode='after')
|
|
77
79
|
def validate_options(self) -> 'PropertyData':
|
|
78
80
|
if isinstance(getattr(self, 'enum', None), list) and not self.options:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
amsdal_utils/Third-Party Materials - AMSDAL Dependencies - License Notices.md,sha256=blZRsT9Qg4u4LzZuxlWQOzlWGpLAg7DugWS6nz7s_yw,62595
|
|
2
|
-
amsdal_utils/__about__.py,sha256=
|
|
2
|
+
amsdal_utils/__about__.py,sha256=glsk81MrslMVQFReYet26elGhdxBZYmME4LF8nyLdxA,124
|
|
3
3
|
amsdal_utils/__init__.py,sha256=EQCJ5OevmkkIpIULumPNIbWk3UI7afDfRzIsZN5mfwg,73
|
|
4
4
|
amsdal_utils/errors.py,sha256=P90oGdKczHZzHukWnzJfbsSxMC-Sc8dUXvHzP7b1IIA,129
|
|
5
5
|
amsdal_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -25,7 +25,7 @@ amsdal_utils/models/base.py,sha256=jcY7ZE6n0lANGjg87sEwlz6val_8ZRHWaCmNZo9Oxnc,1
|
|
|
25
25
|
amsdal_utils/models/enums.py,sha256=1iuixjmfHMIMDM3rEQ1YUjOPF3aV_OEoPq61I61KvGI,745
|
|
26
26
|
amsdal_utils/models/data_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
27
|
amsdal_utils/models/data_models/address.py,sha256=haQmHYfQcQdejgM1KrNIylfNS-0R0KEDH4v2I8sjIWo,6600
|
|
28
|
-
amsdal_utils/models/data_models/core.py,sha256=
|
|
28
|
+
amsdal_utils/models/data_models/core.py,sha256=yRRJsUIafv2yPnxpZXLTmdbO1Pcv_WgIQVy3IDISGYk,8629
|
|
29
29
|
amsdal_utils/models/data_models/enums.py,sha256=qDJDPU5oxPlSNENFNf3PPgxiFJYbTM8OOE8stMmYYHc,4130
|
|
30
30
|
amsdal_utils/models/data_models/metadata.py,sha256=J9r7K2_coE2qD3au-Y7wS2YXcjMUOkW_kx3Gubr3Oyg,2979
|
|
31
31
|
amsdal_utils/models/data_models/reference.py,sha256=hA-06Dq64oMVNv6L6DIelpraxpQJAPiHf4_3UqLmuw4,5098
|
|
@@ -49,7 +49,7 @@ amsdal_utils/query/data_models/paginator.py,sha256=oDEWEdyrEBBkHXyrS4K2mglYVw8An
|
|
|
49
49
|
amsdal_utils/query/data_models/query_specifier.py,sha256=7rEVChU2XPy-3ooaTgfSZGKIOyIIKn8245MMuWrv3Mk,469
|
|
50
50
|
amsdal_utils/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
51
|
amsdal_utils/schemas/interfaces.py,sha256=XJGw45IE7E1HjYArdz2LELOcx15PeTw4L1V34atKm6Y,773
|
|
52
|
-
amsdal_utils/schemas/schema.py,sha256=
|
|
52
|
+
amsdal_utils/schemas/schema.py,sha256=kVstZBTJyeR_P7DJZ3Dblv1whj_2BtWg4CLXGkYQ5Js,6493
|
|
53
53
|
amsdal_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
54
|
amsdal_utils/utils/classes.py,sha256=GeJIt-jxOHgMnlEHMmzNk9vwxv4_V5dLP-Fv89hN5hc,354
|
|
55
55
|
amsdal_utils/utils/decorators.py,sha256=RCWbbQJ2hY2s-uAI0C5M0X8gTXqUbL1Gx9NxACYBMOA,992
|
|
@@ -57,7 +57,7 @@ amsdal_utils/utils/identifier.py,sha256=oP3CHd2i8EBHMVUC8DWLr9pFZBt1IdH7Falaa3M2
|
|
|
57
57
|
amsdal_utils/utils/lazy_object.py,sha256=eIVHBDNCSHKQopzYjviPCuh0svbRJQOCZ8KzqFLiS-s,2115
|
|
58
58
|
amsdal_utils/utils/singleton.py,sha256=DbgQVJdeftO8sGVm2ti4zf4KDaDd2ogclO3B6gxfqag,744
|
|
59
59
|
amsdal_utils/utils/text.py,sha256=4L5aICJGbmFZwNUhMrACb5thqmcIaWb3aVD24lW24a0,1962
|
|
60
|
-
amsdal_utils-0.5.
|
|
61
|
-
amsdal_utils-0.5.
|
|
62
|
-
amsdal_utils-0.5.
|
|
63
|
-
amsdal_utils-0.5.
|
|
60
|
+
amsdal_utils-0.5.2.dist-info/METADATA,sha256=1rKEZqPPLKhnqm0EbTl5Sfn3mL3JLV1WG_j4fhlR3m0,57431
|
|
61
|
+
amsdal_utils-0.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
62
|
+
amsdal_utils-0.5.2.dist-info/licenses/LICENSE.txt,sha256=hG-541PFYfNJi9WRZi_hno91UyqNg7YLK8LR3vLblZA,27355
|
|
63
|
+
amsdal_utils-0.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|