pyopenapi-gen 0.20.1__py3-none-any.whl → 0.21.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 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.20.1"
53
+ __version__: str = "0.21.0"
54
54
 
55
55
  # ---------------------------------------------------------------------------
56
56
  # Lazy-loading and autocompletion support (This part remains)
@@ -328,10 +328,12 @@ class DataclassSerializer:
328
328
  The serialized object with dataclasses converted to dictionaries.
329
329
 
330
330
  Handles:
331
- - Dataclass instances: Converted to dictionaries
331
+ - BaseSchema instances: Uses to_dict() method with field name mapping (e.g., snake_case -> camelCase)
332
+ - Regular dataclass instances: Converted to dictionaries using field names
332
333
  - Lists: Recursively serialize each item
333
334
  - Dictionaries: Recursively serialize values
334
335
  - datetime: Convert to ISO format string
336
+ - Enums: Convert to their value
335
337
  - Primitives: Return unchanged
336
338
  - None values: Excluded from output
337
339
  """
@@ -363,7 +365,24 @@ class DataclassSerializer:
363
365
  if isinstance(obj, Enum) and not isinstance(obj, type):
364
366
  return obj.value
365
367
 
366
- # Handle dataclass instances
368
+ # Handle BaseSchema instances (respects field name mappings)
369
+ # Check for BaseSchema by looking for both to_dict and _get_field_mappings methods
370
+ if hasattr(obj, "to_dict") and hasattr(obj, "_get_field_mappings") and callable(obj.to_dict):
371
+ visited.add(obj_id)
372
+ try:
373
+ # Use BaseSchema's to_dict() which handles field name mapping
374
+ result_dict = obj.to_dict(exclude_none=True)
375
+ # Recursively serialize nested objects in the result
376
+ serialized_result = {}
377
+ for key, value in result_dict.items():
378
+ serialized_value = DataclassSerializer._serialize_with_tracking(value, visited)
379
+ if serialized_value is not None:
380
+ serialized_result[key] = serialized_value
381
+ return serialized_result
382
+ finally:
383
+ visited.discard(obj_id)
384
+
385
+ # Handle regular dataclass instances (no field mapping)
367
386
  if dataclasses.is_dataclass(obj) and not isinstance(obj, type):
368
387
  visited.add(obj_id)
369
388
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyopenapi-gen
3
- Version: 0.20.1
3
+ Version: 0.21.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=AAHPrKYYe_xNqjTYJxWB4YZFzmGsIMIsResorFRQYso,7533
1
+ pyopenapi_gen/__init__.py,sha256=ECOG-WufAa6d3s8kjwlsVWeX36Up20eOvmQ937k_XjU,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=--FdLkVWn7Bz1-8Mktsierzy4cOnN7YIr4UV-SD2vTs,14297
21
+ pyopenapi_gen/core/utils.py,sha256=VK2TojBe6esfbhSy87kpra4Cguc0iv5teD-T7beI43Q,15435
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
@@ -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.20.1.dist-info/METADATA,sha256=aLIMp4fHbHXCAdEtngq92k6HFEj4E0L_RwplsXUkumY,20551
130
- pyopenapi_gen-0.20.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
131
- pyopenapi_gen-0.20.1.dist-info/entry_points.txt,sha256=gxSlNiwom50T3OEZnlocA6qRjGdV0bn6hN_Xr-Ub5wA,56
132
- pyopenapi_gen-0.20.1.dist-info/licenses/LICENSE,sha256=UFAyTWKa4w10-QerlJaHJeep7G2gcwpf-JmvI2dS2Gc,1088
133
- pyopenapi_gen-0.20.1.dist-info/RECORD,,
129
+ pyopenapi_gen-0.21.0.dist-info/METADATA,sha256=1pV5cwvDDwbov58u-7Ibb-H3iEvt06lM-QvOkFts270,20551
130
+ pyopenapi_gen-0.21.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
131
+ pyopenapi_gen-0.21.0.dist-info/entry_points.txt,sha256=gxSlNiwom50T3OEZnlocA6qRjGdV0bn6hN_Xr-Ub5wA,56
132
+ pyopenapi_gen-0.21.0.dist-info/licenses/LICENSE,sha256=UFAyTWKa4w10-QerlJaHJeep7G2gcwpf-JmvI2dS2Gc,1088
133
+ pyopenapi_gen-0.21.0.dist-info/RECORD,,