openapi-generators / openapi-python-client

Generate modern Python clients from OpenAPI
MIT License
1.26k stars 195 forks source link

VSCode pylance raised `reportPrivateImportUsage` error. #675

Closed EltonChou closed 1 year ago

EltonChou commented 1 year ago

Describe the bug In vscode, current templates will cause pylance to raises the reportPrivateImportUsage.

To Reproduce

try.py

from the_client import AuthenticatedClient
from the_client.api.the_tag import get_stuff
from the_client.models import Stuff

pylance message:

"AuthenticatedClient" is not exported from module "the_client"
 Import from "the_client.client" instead
"Stuff" is not exported from module "the_client.models"
 Import from "the_client.models.stuff" instead`

Expected behavior The class should be imported without any error message. It can be fixed by adding __all__ symbol to solve this issue. ref: https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface

OpenAPI Spec File Not related to OpenAPI spec.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

dbanty commented 1 year ago

Relates to #631 & #540 I think