digitalkin 0.3.2.dev28__py3-none-any.whl → 0.3.2.dev29__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.
- digitalkin/__version__.py +1 -1
- digitalkin/utils/schema_splitter.py +41 -8
- {digitalkin-0.3.2.dev28.dist-info → digitalkin-0.3.2.dev29.dist-info}/METADATA +1 -1
- {digitalkin-0.3.2.dev28.dist-info → digitalkin-0.3.2.dev29.dist-info}/RECORD +7 -7
- {digitalkin-0.3.2.dev28.dist-info → digitalkin-0.3.2.dev29.dist-info}/WHEEL +0 -0
- {digitalkin-0.3.2.dev28.dist-info → digitalkin-0.3.2.dev29.dist-info}/licenses/LICENSE +0 -0
- {digitalkin-0.3.2.dev28.dist-info → digitalkin-0.3.2.dev29.dist-info}/top_level.txt +0 -0
digitalkin/__version__.py
CHANGED
|
@@ -58,7 +58,7 @@ class SchemaSplitter:
|
|
|
58
58
|
cls._extract_ui_properties(value, items_ui, defs)
|
|
59
59
|
if items_ui:
|
|
60
60
|
ui_target["items"] = items_ui
|
|
61
|
-
elif key
|
|
61
|
+
elif key in {"allOf", "oneOf", "anyOf"} and isinstance(value, list):
|
|
62
62
|
for item in value:
|
|
63
63
|
if isinstance(item, dict):
|
|
64
64
|
cls._extract_ui_properties(item, ui_target, defs)
|
|
@@ -71,7 +71,7 @@ class SchemaSplitter:
|
|
|
71
71
|
cls._extract_ui_properties(defs[def_name], ui_target, defs)
|
|
72
72
|
|
|
73
73
|
@classmethod
|
|
74
|
-
def _process_object( # noqa: C901, PLR0912
|
|
74
|
+
def _process_object( # noqa: C901, PLR0912, PLR0915
|
|
75
75
|
cls,
|
|
76
76
|
source: dict[str, Any],
|
|
77
77
|
json_target: dict[str, Any],
|
|
@@ -123,13 +123,24 @@ class SchemaSplitter:
|
|
|
123
123
|
json_target["allOf"] = []
|
|
124
124
|
for item in value:
|
|
125
125
|
if isinstance(item, dict):
|
|
126
|
-
|
|
127
|
-
cls._strip_ui_properties(item,
|
|
128
|
-
json_target["allOf"].append(
|
|
126
|
+
item_json_all_of: dict[str, Any] = {}
|
|
127
|
+
cls._strip_ui_properties(item, item_json_all_of)
|
|
128
|
+
json_target["allOf"].append(item_json_all_of)
|
|
129
129
|
# Extract UI properties from allOf item
|
|
130
130
|
cls._extract_ui_properties(item, ui_target, schema_defs)
|
|
131
131
|
else:
|
|
132
132
|
json_target["allOf"].append(item)
|
|
133
|
+
elif key in {"oneOf", "anyOf"} and isinstance(value, list):
|
|
134
|
+
json_target[key] = []
|
|
135
|
+
for item in value:
|
|
136
|
+
if isinstance(item, dict):
|
|
137
|
+
item_json_oneof_anyof: dict[str, Any] = {}
|
|
138
|
+
cls._strip_ui_properties(item, item_json_oneof_anyof)
|
|
139
|
+
json_target[key].append(item_json_oneof_anyof)
|
|
140
|
+
# Extract UI properties from oneOf/anyOf item (resolves $ref)
|
|
141
|
+
cls._extract_ui_properties(item, ui_target, schema_defs)
|
|
142
|
+
else:
|
|
143
|
+
json_target[key].append(item)
|
|
133
144
|
elif key in {"if", "then", "else"} and isinstance(value, dict):
|
|
134
145
|
json_target[key] = {}
|
|
135
146
|
cls._strip_ui_properties(value, json_target[key])
|
|
@@ -187,6 +198,19 @@ class SchemaSplitter:
|
|
|
187
198
|
cls._process_property(value, json_target["items"], items_ui, defs_ui)
|
|
188
199
|
if items_ui:
|
|
189
200
|
ui_target["items"] = items_ui
|
|
201
|
+
elif key in {"oneOf", "anyOf"} and isinstance(value, list):
|
|
202
|
+
json_target[key] = []
|
|
203
|
+
for item in value:
|
|
204
|
+
if isinstance(item, dict):
|
|
205
|
+
item_json_oneof_anyof: dict[str, Any] = {}
|
|
206
|
+
cls._strip_ui_properties(item, item_json_oneof_anyof)
|
|
207
|
+
json_target[key].append(item_json_oneof_anyof)
|
|
208
|
+
# Extract UI properties from $ref in oneOf/anyOf items
|
|
209
|
+
ref_path = item.get("$ref", "")
|
|
210
|
+
if ref_path.startswith("#/$defs/") and ref_path[8:] in defs_ui:
|
|
211
|
+
ui_target.update(defs_ui[ref_path[8:]])
|
|
212
|
+
else:
|
|
213
|
+
json_target[key].append(item)
|
|
190
214
|
elif key == "hidden":
|
|
191
215
|
# Strip hidden key from json schema
|
|
192
216
|
continue
|
|
@@ -230,11 +254,20 @@ class SchemaSplitter:
|
|
|
230
254
|
json_target["allOf"] = []
|
|
231
255
|
for item in value:
|
|
232
256
|
if isinstance(item, dict):
|
|
233
|
-
|
|
234
|
-
cls._strip_ui_properties(item,
|
|
235
|
-
json_target["allOf"].append(
|
|
257
|
+
item_json_all_of: dict[str, Any] = {}
|
|
258
|
+
cls._strip_ui_properties(item, item_json_all_of)
|
|
259
|
+
json_target["allOf"].append(item_json_all_of)
|
|
236
260
|
else:
|
|
237
261
|
json_target["allOf"].append(item)
|
|
262
|
+
elif key in {"oneOf", "anyOf"} and isinstance(value, list):
|
|
263
|
+
json_target[key] = []
|
|
264
|
+
for item in value:
|
|
265
|
+
if isinstance(item, dict):
|
|
266
|
+
item_json_oneof_anyof: dict[str, Any] = {}
|
|
267
|
+
cls._strip_ui_properties(item, item_json_oneof_anyof)
|
|
268
|
+
json_target[key].append(item_json_oneof_anyof)
|
|
269
|
+
else:
|
|
270
|
+
json_target[key].append(item)
|
|
238
271
|
elif key in {"if", "then", "else"} and isinstance(value, dict):
|
|
239
272
|
json_target[key] = {}
|
|
240
273
|
cls._strip_ui_properties(value, json_target[key])
|
|
@@ -7,7 +7,7 @@ base_server/mock/__init__.py,sha256=YZFT-F1l_TpvJYuIPX-7kTeE1CfOjhx9YmNRXVoi-jQ,
|
|
|
7
7
|
base_server/mock/mock_pb2.py,sha256=sETakcS3PAAm4E-hTCV1jIVaQTPEAIoVVHupB8Z_k7Y,1843
|
|
8
8
|
base_server/mock/mock_pb2_grpc.py,sha256=BbOT70H6q3laKgkHfOx1QdfmCS_HxCY4wCOX84YAdG4,3180
|
|
9
9
|
digitalkin/__init__.py,sha256=7LLBAba0th-3SGqcpqFO-lopWdUkVLKzLZiMtB-mW3M,162
|
|
10
|
-
digitalkin/__version__.py,sha256=
|
|
10
|
+
digitalkin/__version__.py,sha256=Im4DuiSZXozbB4vfOcuT3XJEFnqtXOltBpIWCMj0itI,196
|
|
11
11
|
digitalkin/logger.py,sha256=8ze_tjt2G6mDTuQcsf7-UTXWP3UHZ7LZVSs_iqF4rX4,4685
|
|
12
12
|
digitalkin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
digitalkin/core/__init__.py,sha256=FJRcJ-B1Viyn-38L8XpOpZ8KOnf1I7PCDOAmKXLQhqc,71
|
|
@@ -122,8 +122,8 @@ digitalkin/utils/development_mode_action.py,sha256=2hznh0ajW_4ZTysfoc0Y49161f_PQ
|
|
|
122
122
|
digitalkin/utils/dynamic_schema.py,sha256=y5csxjuqVHjWDpnTUzxbcUuI_wou9-ibRVHQlBs_btY,15275
|
|
123
123
|
digitalkin/utils/llm_ready_schema.py,sha256=JjMug_lrQllqFoanaC091VgOqwAd-_YzcpqFlS7p778,2375
|
|
124
124
|
digitalkin/utils/package_discover.py,sha256=sa6Zp5Kape1Zr4iYiNrnZxiHDnqM06ODk6yfWHom53w,13465
|
|
125
|
-
digitalkin/utils/schema_splitter.py,sha256=
|
|
126
|
-
digitalkin-0.3.2.
|
|
125
|
+
digitalkin/utils/schema_splitter.py,sha256=x_clDCbdpquKZP_4RLOkVs-WoSRXpAqYFKSxJfrZDVA,13125
|
|
126
|
+
digitalkin-0.3.2.dev29.dist-info/licenses/LICENSE,sha256=Ies4HFv2r2hzDRakJYxk3Y60uDFLiG-orIgeTpstnIo,20327
|
|
127
127
|
modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
128
128
|
modules/archetype_with_tools_module.py,sha256=kJkVhAFWG0aDDqzupOXOnV3l8j3z5bEdWos_6Z9rUP8,7303
|
|
129
129
|
modules/cpu_intensive_module.py,sha256=GZlirQDZdYuXrI46sv1q4RNAHZjL4EptHVQTvgK9zz8,8363
|
|
@@ -138,7 +138,7 @@ monitoring/digitalkin_observability/prometheus.py,sha256=gDmM9ySaVwPAe7Yg84pLxmE
|
|
|
138
138
|
monitoring/tests/test_metrics.py,sha256=ugnYfAwqBPO6zA8z4afKTlyBWECTivacYSN-URQCn2E,5856
|
|
139
139
|
services/filesystem_module.py,sha256=U4dgqtuDadaXz8PJ1d_uQ_1EPncBqudAQCLUICF9yL4,7421
|
|
140
140
|
services/storage_module.py,sha256=Wz2MzLvqs2D_bnBBgtnujYcAKK2V2KFMk8K21RoepSE,6972
|
|
141
|
-
digitalkin-0.3.2.
|
|
142
|
-
digitalkin-0.3.2.
|
|
143
|
-
digitalkin-0.3.2.
|
|
144
|
-
digitalkin-0.3.2.
|
|
141
|
+
digitalkin-0.3.2.dev29.dist-info/METADATA,sha256=tCHE0ptPvwBsNYoRymS8PxdcE0LICtZCr5UAgIgxzJo,29725
|
|
142
|
+
digitalkin-0.3.2.dev29.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
143
|
+
digitalkin-0.3.2.dev29.dist-info/top_level.txt,sha256=AYVIesKrO0jnedQ-Muog9JBehG81WeTCNeOFoJgwsgE,51
|
|
144
|
+
digitalkin-0.3.2.dev29.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|