You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model import shadows HTTP Client import when a schema is named Client #1423
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