Skip to content

Commit ee43748

Browse files
committed
fix: Prevent generating Python files named the same as reserved / key words.
1 parent bc37409 commit ee43748

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openapi_python_client/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def _build_api(self) -> None:
270270
)
271271

272272
for endpoint in collection.endpoints:
273-
module_path = tag_dir / f"{snake_case(endpoint.name)}.py"
273+
module_path = tag_dir / f"{utils.PythonIdentifier(endpoint.name, self.config.field_prefix)}.py"
274274
module_path.write_text(endpoint_template.render(endpoint=endpoint), encoding=self.file_encoding)
275275

276276

0 commit comments

Comments
 (0)