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
Desktop (please complete the following information):
OS: [e.g. Ubuntu 22.04]
Python Version: [e.g. 3.10.12]
openapi-python-client version [e.g. 0.19.1]
Additional context
The generator outputs:
Generating fast-api-client
Error(s) encountered while generating, client was not created
ruff failed
fast_api_client/api/default/client_client_get.py:8:30: F811 Redefinition of unused `Client` from line 7
Found 16 errors (15 fixed, 1 remaining).
In the relevant code there are two imports:
from ...clientimportAuthenticatedClient, Clientfrom ...models.clientimportClient
As hinted by ruff' error message there are two imports that load a Client object but they are loading different objects.
If you ty to use the generated code:
It will still work properly as the only Client type that is actually used at runtime is the one from models which is imported last (the Client from client is only used for type-hinting).
The text was updated successfully, but these errors were encountered:
This could be solved by updating the templates to only from ... import models and then referring to the models with the full qualification (like models.client.Client).
Describe the bug
If a model of the Openapi App is called
Client
this name collides with theclient.Client
object in imports.OpenAPI Spec File
Desktop (please complete the following information):
Additional context
The generator outputs:
In the relevant code there are two imports:
As hinted by ruff' error message there are two imports that load a
Client
object but they are loading different objects.If you ty to use the generated code:
It will still work properly as the only
Client
type that is actually used at runtime is the one frommodels
which is imported last (theClient
fromclient
is only used for type-hinting).The text was updated successfully, but these errors were encountered: