pyopenapi-gen 0.18.0__py3-none-any.whl → 0.20.0__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.
Potentially problematic release.
This version of pyopenapi-gen might be problematic. Click here for more details.
- pyopenapi_gen/__init__.py +1 -1
- pyopenapi_gen/core/utils.py +5 -0
- pyopenapi_gen/visit/endpoint/generators/endpoint_method_generator.py +6 -3
- {pyopenapi_gen-0.18.0.dist-info → pyopenapi_gen-0.20.0.dist-info}/METADATA +1 -1
- {pyopenapi_gen-0.18.0.dist-info → pyopenapi_gen-0.20.0.dist-info}/RECORD +8 -8
- {pyopenapi_gen-0.18.0.dist-info → pyopenapi_gen-0.20.0.dist-info}/WHEEL +0 -0
- {pyopenapi_gen-0.18.0.dist-info → pyopenapi_gen-0.20.0.dist-info}/entry_points.txt +0 -0
- {pyopenapi_gen-0.18.0.dist-info → pyopenapi_gen-0.20.0.dist-info}/licenses/LICENSE +0 -0
pyopenapi_gen/__init__.py
CHANGED
|
@@ -50,7 +50,7 @@ __all__ = [
|
|
|
50
50
|
]
|
|
51
51
|
|
|
52
52
|
# Semantic version of the generator core – automatically managed by semantic-release.
|
|
53
|
-
__version__: str = "0.
|
|
53
|
+
__version__: str = "0.20.0"
|
|
54
54
|
|
|
55
55
|
# ---------------------------------------------------------------------------
|
|
56
56
|
# Lazy-loading and autocompletion support (This part remains)
|
pyopenapi_gen/core/utils.py
CHANGED
|
@@ -341,6 +341,7 @@ class DataclassSerializer:
|
|
|
341
341
|
@staticmethod
|
|
342
342
|
def _serialize_with_tracking(obj: Any, visited: Set[int]) -> Any:
|
|
343
343
|
"""Internal serialization method with circular reference tracking."""
|
|
344
|
+
from enum import Enum
|
|
344
345
|
|
|
345
346
|
# Handle None values by excluding them
|
|
346
347
|
if obj is None:
|
|
@@ -358,6 +359,10 @@ class DataclassSerializer:
|
|
|
358
359
|
if isinstance(obj, datetime):
|
|
359
360
|
return obj.isoformat()
|
|
360
361
|
|
|
362
|
+
# Handle enum instances
|
|
363
|
+
if isinstance(obj, Enum) and not isinstance(obj, type):
|
|
364
|
+
return obj.value
|
|
365
|
+
|
|
361
366
|
# Handle dataclass instances
|
|
362
367
|
if dataclasses.is_dataclass(obj) and not isinstance(obj, type):
|
|
363
368
|
visited.add(obj_id)
|
|
@@ -130,6 +130,9 @@ class EndpointMethodGenerator:
|
|
|
130
130
|
|
|
131
131
|
writer = CodeWriter()
|
|
132
132
|
|
|
133
|
+
# Import DataclassSerializer for automatic conversion
|
|
134
|
+
context.add_import(f"{context.core_package_name}.utils", "DataclassSerializer")
|
|
135
|
+
|
|
133
136
|
# Generate implementation signature (accepts all content-type parameters as optional)
|
|
134
137
|
impl_sig = self.overload_generator.generate_implementation_signature(op, context, response_strategy)
|
|
135
138
|
writer.write_block(impl_sig)
|
|
@@ -168,7 +171,7 @@ class EndpointMethodGenerator:
|
|
|
168
171
|
|
|
169
172
|
# Generate request call for this content type
|
|
170
173
|
if content_type == "application/json":
|
|
171
|
-
writer.write_line(f"json_body = {param_info['name']}")
|
|
174
|
+
writer.write_line(f"json_body = DataclassSerializer.serialize({param_info['name']})")
|
|
172
175
|
writer.write_line("response = await self._transport.request(")
|
|
173
176
|
writer.indent()
|
|
174
177
|
writer.write_line(f'"{op.method.value.upper()}", url,')
|
|
@@ -178,7 +181,7 @@ class EndpointMethodGenerator:
|
|
|
178
181
|
writer.dedent()
|
|
179
182
|
writer.write_line(")")
|
|
180
183
|
elif content_type == "multipart/form-data":
|
|
181
|
-
writer.write_line(f"files_data = {param_info['name']}")
|
|
184
|
+
writer.write_line(f"files_data = DataclassSerializer.serialize({param_info['name']})")
|
|
182
185
|
writer.write_line("response = await self._transport.request(")
|
|
183
186
|
writer.indent()
|
|
184
187
|
writer.write_line(f'"{op.method.value.upper()}", url,')
|
|
@@ -188,7 +191,7 @@ class EndpointMethodGenerator:
|
|
|
188
191
|
writer.dedent()
|
|
189
192
|
writer.write_line(")")
|
|
190
193
|
else:
|
|
191
|
-
writer.write_line(f"data = {param_info['name']}")
|
|
194
|
+
writer.write_line(f"data = DataclassSerializer.serialize({param_info['name']})")
|
|
192
195
|
writer.write_line("response = await self._transport.request(")
|
|
193
196
|
writer.indent()
|
|
194
197
|
writer.write_line(f'"{op.method.value.upper()}", url,')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyopenapi-gen
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.0
|
|
4
4
|
Summary: Modern, async-first Python client generator for OpenAPI specifications with advanced cycle detection and unified type resolution
|
|
5
5
|
Project-URL: Homepage, https://github.com/your-org/pyopenapi-gen
|
|
6
6
|
Project-URL: Documentation, https://github.com/your-org/pyopenapi-gen/blob/main/README.md
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pyopenapi_gen/__init__.py,sha256=
|
|
1
|
+
pyopenapi_gen/__init__.py,sha256=7tPgmApPAqQDxIpBEwskl1RD3ao1g0E9H4JE2O3YeQs,7533
|
|
2
2
|
pyopenapi_gen/__main__.py,sha256=4-SCaCNhBd7rtyRK58uoDbdl93J0KhUeajP_b0CPpLE,110
|
|
3
3
|
pyopenapi_gen/cli.py,sha256=9T_XF3-ih_JlM_BOkmHft-HoMCGOqL5UrnAHBJ0fb5w,2320
|
|
4
4
|
pyopenapi_gen/http_types.py,sha256=EMMYZBt8PNVZKPFu77TQija-JI-nOKyXvpiQP9-VSWE,467
|
|
@@ -18,7 +18,7 @@ pyopenapi_gen/core/postprocess_manager.py,sha256=Ia4H47lInhVxkHnDB46t4U-6BLpLXzh
|
|
|
18
18
|
pyopenapi_gen/core/schemas.py,sha256=Ngehd-Aj4Drs_5i7eL0L5Eu1B_kfT4qxL94TJ_H_I7w,5523
|
|
19
19
|
pyopenapi_gen/core/streaming_helpers.py,sha256=5fkzH9xsgzZWOTKFrZpmje07S7n7CcOpjteb5dig7ds,2664
|
|
20
20
|
pyopenapi_gen/core/telemetry.py,sha256=LNMrlrUNVcp591w9cX4uvzlFrPB6ZZoGRIuCOHlDCqA,2296
|
|
21
|
-
pyopenapi_gen/core/utils.py,sha256
|
|
21
|
+
pyopenapi_gen/core/utils.py,sha256=--FdLkVWn7Bz1-8Mktsierzy4cOnN7YIr4UV-SD2vTs,14297
|
|
22
22
|
pyopenapi_gen/core/warning_collector.py,sha256=DYl9D7eZYs04mDU84KeonS-5-d0aM7hNqraXTex31ss,2799
|
|
23
23
|
pyopenapi_gen/core/auth/base.py,sha256=E2KUerA_mYv9D7xulUm-lenIxqZHqanjA4oRKpof2ZE,792
|
|
24
24
|
pyopenapi_gen/core/auth/plugins.py,sha256=u4GZTykoxGwGaWAQyFeTdPKi-pSK7Dp0DCeg5RsrSw4,3446
|
|
@@ -112,7 +112,7 @@ pyopenapi_gen/visit/endpoint/__init__.py,sha256=DftIZSWp6Z8jKWoJE2VGKL4G_5cqwFXe
|
|
|
112
112
|
pyopenapi_gen/visit/endpoint/endpoint_visitor.py,sha256=1aS0i2D_Y-979_7aBd0W6IS2UVO6wMujsMMw8Qt8PRE,3574
|
|
113
113
|
pyopenapi_gen/visit/endpoint/generators/__init__.py,sha256=-X-GYnJZ9twiEBr_U0obW8VuSoY6IJmYaxinn-seMzA,50
|
|
114
114
|
pyopenapi_gen/visit/endpoint/generators/docstring_generator.py,sha256=_VpRabZ2g_N42TTWGI6gtPxqzlZD65dOHm8U_YvtWbQ,5891
|
|
115
|
-
pyopenapi_gen/visit/endpoint/generators/endpoint_method_generator.py,sha256=
|
|
115
|
+
pyopenapi_gen/visit/endpoint/generators/endpoint_method_generator.py,sha256=W_i_8KYZanVP-dA2sWCfDJ50jV_RzefrWGPGbJKDTwM,10242
|
|
116
116
|
pyopenapi_gen/visit/endpoint/generators/overload_generator.py,sha256=1W8pt5iUSDsgxJJUoxfQyRZkxCwFi1WbvVM__SazCe0,9074
|
|
117
117
|
pyopenapi_gen/visit/endpoint/generators/request_generator.py,sha256=MKtZ6Fa050gCgqAGhXeo--p_AzqV9RmDd8e4Zvglgo0,5349
|
|
118
118
|
pyopenapi_gen/visit/endpoint/generators/response_handler_generator.py,sha256=Jb_8hRQY1OfpThupa7UdCNxa712m3WaeNIbLhlYk1bg,24193
|
|
@@ -126,8 +126,8 @@ pyopenapi_gen/visit/model/alias_generator.py,sha256=wEMHipPA1_CFxvQ6CS9j4qgXK93s
|
|
|
126
126
|
pyopenapi_gen/visit/model/dataclass_generator.py,sha256=L794s2yyYUO__akGd120NJMV7g2xqiPfQyZo8CduIVM,14426
|
|
127
127
|
pyopenapi_gen/visit/model/enum_generator.py,sha256=AXqKUFuWUUjUF_6_HqBKY8vB5GYu35Pb2C2WPFrOw1k,10061
|
|
128
128
|
pyopenapi_gen/visit/model/model_visitor.py,sha256=TC6pbxpQiy5FWhmQpfllLuXA3ImTYNMcrazkOFZCIyo,9470
|
|
129
|
-
pyopenapi_gen-0.
|
|
130
|
-
pyopenapi_gen-0.
|
|
131
|
-
pyopenapi_gen-0.
|
|
132
|
-
pyopenapi_gen-0.
|
|
133
|
-
pyopenapi_gen-0.
|
|
129
|
+
pyopenapi_gen-0.20.0.dist-info/METADATA,sha256=x2Q2IjV_O4XMsJQ7_OVvIPBWeGMThwM_LjrFEgR2JQY,20551
|
|
130
|
+
pyopenapi_gen-0.20.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
131
|
+
pyopenapi_gen-0.20.0.dist-info/entry_points.txt,sha256=gxSlNiwom50T3OEZnlocA6qRjGdV0bn6hN_Xr-Ub5wA,56
|
|
132
|
+
pyopenapi_gen-0.20.0.dist-info/licenses/LICENSE,sha256=UFAyTWKa4w10-QerlJaHJeep7G2gcwpf-JmvI2dS2Gc,1088
|
|
133
|
+
pyopenapi_gen-0.20.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|