pyopenapi-gen 0.14.1__py3-none-any.whl → 0.14.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.
@@ -108,12 +108,16 @@ class EndpointsEmitter:
108
108
  self.formatter = Formatter()
109
109
  self.visitor: EndpointVisitor | None = None
110
110
 
111
- def _deduplicate_operation_ids(self, operations: List[IROperation]) -> None:
111
+ def _deduplicate_operation_ids_globally(self, operations: List[IROperation]) -> None:
112
112
  """
113
- Ensures all operations have unique method names within a tag.
113
+ Ensures all operations have unique method names globally across all tags.
114
+
115
+ This prevents the bug where operations with multiple tags share the same
116
+ IROperation object reference, causing _deduplicate_operation_ids() to
117
+ modify the same object multiple times and accumulate _2_2 suffixes.
114
118
 
115
119
  Args:
116
- operations: List of operations for a single tag.
120
+ operations: List of all operations across all tags.
117
121
  """
118
122
  seen_methods: dict[str, int] = {}
119
123
  for op in operations:
@@ -156,6 +160,10 @@ class EndpointsEmitter:
156
160
  if self.visitor is None:
157
161
  self.visitor = EndpointVisitor(current_parsed_schemas) # Pass the (potentially defaulted) dict
158
162
 
163
+ # Deduplicate operation IDs globally BEFORE tag grouping to prevent
164
+ # multi-tag operations from accumulating _2_2 suffixes
165
+ self._deduplicate_operation_ids_globally(operations)
166
+
159
167
  tag_key_to_ops: dict[str, List[IROperation]] = {}
160
168
  tag_key_to_candidates: dict[str, List[str]] = {}
161
169
  for op in operations:
@@ -194,7 +202,7 @@ class EndpointsEmitter:
194
202
  # This will set current_file and reset+reinit import_collector's context
195
203
  self.context.set_current_file(str(file_path))
196
204
 
197
- self._deduplicate_operation_ids(ops_for_tag)
205
+ # Deduplication now done globally before tag grouping (see above)
198
206
 
199
207
  # EndpointVisitor must exist here due to check above
200
208
  if self.visitor is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyopenapi-gen
3
- Version: 0.14.1
3
+ Version: 0.14.2
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
@@ -71,7 +71,7 @@ pyopenapi_gen/emitters/CLAUDE.md,sha256=iZYEZq1a1h033rxuh97cMpsKUElv72ysvTm3-QQU
71
71
  pyopenapi_gen/emitters/client_emitter.py,sha256=kmMVnG-wAOJm7TUm0xOQ5YnSJfYxz1SwtpiyoUCbcCA,1939
72
72
  pyopenapi_gen/emitters/core_emitter.py,sha256=YSuqDlYv3P687TsVT_Z9n7a6GZepGAvv3-N1Q2kK6Zg,7975
73
73
  pyopenapi_gen/emitters/docs_emitter.py,sha256=aouKqhRdtVvYfGVsye_uqM80nONRy0SqN06cr1l3OgA,1137
74
- pyopenapi_gen/emitters/endpoints_emitter.py,sha256=iAEGYf5uIo6STY0Pr2ZFvR3ncYNiCF4pHMWmfV9bWRQ,9558
74
+ pyopenapi_gen/emitters/endpoints_emitter.py,sha256=0DXOXu2Yb3DRTic_k63q2L-yKS6ZFdhbcBCK3DPZU3Y,10040
75
75
  pyopenapi_gen/emitters/exceptions_emitter.py,sha256=PfbDQX7dfgg2htvxEh40t7FR7b3BrK8jeRd5INu_kjk,7547
76
76
  pyopenapi_gen/emitters/models_emitter.py,sha256=wJwtvCGEmhy5yhojfoUW2CXNOQytGlN4J8-GcwoYIMY,22221
77
77
  pyopenapi_gen/generator/CLAUDE.md,sha256=BS9KkmLvk2WD-Io-_apoWjGNeMU4q4LKy4UOxYF9WxM,10870
@@ -125,8 +125,8 @@ pyopenapi_gen/visit/model/alias_generator.py,sha256=wEMHipPA1_CFxvQ6CS9j4qgXK93s
125
125
  pyopenapi_gen/visit/model/dataclass_generator.py,sha256=z0kKH_V2PJyiI9snmryDpAzRiOsQJtk1jrijCnEQQwg,14326
126
126
  pyopenapi_gen/visit/model/enum_generator.py,sha256=AXqKUFuWUUjUF_6_HqBKY8vB5GYu35Pb2C2WPFrOw1k,10061
127
127
  pyopenapi_gen/visit/model/model_visitor.py,sha256=TC6pbxpQiy5FWhmQpfllLuXA3ImTYNMcrazkOFZCIyo,9470
128
- pyopenapi_gen-0.14.1.dist-info/METADATA,sha256=nrkOgt8QTl8I0Mb8NDX5q16pkVmJy90JFF3HY6vdxsg,14025
129
- pyopenapi_gen-0.14.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
130
- pyopenapi_gen-0.14.1.dist-info/entry_points.txt,sha256=gxSlNiwom50T3OEZnlocA6qRjGdV0bn6hN_Xr-Ub5wA,56
131
- pyopenapi_gen-0.14.1.dist-info/licenses/LICENSE,sha256=UFAyTWKa4w10-QerlJaHJeep7G2gcwpf-JmvI2dS2Gc,1088
132
- pyopenapi_gen-0.14.1.dist-info/RECORD,,
128
+ pyopenapi_gen-0.14.2.dist-info/METADATA,sha256=ERW_JKw-KdBCYXTQsG1sSXDYV9ILr9GgnKEvzfgHHNY,14025
129
+ pyopenapi_gen-0.14.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
130
+ pyopenapi_gen-0.14.2.dist-info/entry_points.txt,sha256=gxSlNiwom50T3OEZnlocA6qRjGdV0bn6hN_Xr-Ub5wA,56
131
+ pyopenapi_gen-0.14.2.dist-info/licenses/LICENSE,sha256=UFAyTWKa4w10-QerlJaHJeep7G2gcwpf-JmvI2dS2Gc,1088
132
+ pyopenapi_gen-0.14.2.dist-info/RECORD,,