Skip to content

Commit 0a825aa

Browse files
committed
feat: Import endpoint modules in __init__
1 parent 5fcaf72 commit 0a825aa

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

openapi_python_client/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ def _build_api(self) -> None:
276276
endpoint_init_path = tag_dir / "__init__.py"
277277
endpoint_init_template = self.env.get_template("endpoint_init.py.jinja")
278278
endpoint_init_path.write_text(
279-
endpoint_init_template.render(endpoint_collection=collection),
279+
endpoint_init_template.render(
280+
endpoint_collection=collection,
281+
modules=(utils.PythonIdentifier(endpoint.name, self.config.field_prefix) \
282+
for endpoint in collection.endpoints),
283+
),
280284
encoding=self.config.file_encoding,
281285
)
282286

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
""" Contains endpoint functions for accessing the API """
2+
from . import {{ modules | join(", ") }}

0 commit comments

Comments
 (0)