When an OpenAPI spec contains a schema named Client, the generated endpoint modules import both the HTTP Client class and the Client model class under the same name. The model import silently shadows the HTTP client import, making Client in type annotations refer to the wrong class.
endpoint_module.py.jinja unconditionally emits:
from ...clientimportAuthenticatedClient, Client
Then endpoint.relative_imports adds model imports. When a model is also named Client, the result is:
from ...clientimportAuthenticatedClient, Client# HTTP clientfrom ...models.clientimportClient# model — shadows the line above
This causes Client in _parse_response and _build_response type annotations to resolve to the model instead of the HTTP client class.
Activity