Skip to content

Docstring generated for sync and asyncio have incorrect return type #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
m3brown opened this issue May 19, 2022 · 1 comment
Closed
Labels
🐞bug Something isn't working

Comments

@m3brown
Copy link

m3brown commented May 19, 2022

Describe the bug
The sync_detailed and asyncio_detailed functions return type Response[...]

The non-detailed sync and asyncio functions return Response.parsed

The docstrings do not reflect this, though, because Response[...] is hard coded into the template used for generating the docstring for both functions.

This results in generated code where the type hint return type (Optional) is the not same as the docstring return type (Response)

def sync(
    account_id: str,
    *,
    client: AuthenticatedClient,
) -> Optional[Union[Any, ProblemDetails, UserDto]]:
    """Lookup user by accountId. (Auth policies: user)
    Args:
        account_id (str):
    Returns:
        Response[Union[Any, ProblemDetails, UserDto]]
    """

    return sync_detailed(
        account_id=account_id,
        client=client,
    ).parsed

To Reproduce
TODO

Expected behavior
The doctstring return type is identical to the type hint

OpenAPI Spec File
TODO

Desktop (please complete the following information):

  • OS: Mac OS 12.3.1
  • Python Version: 3.9.11
  • openapi-python-client version: 0.11.1

Additional context
Add any other context about the problem here.

@m3brown m3brown added the 🐞bug Something isn't working label May 19, 2022
@dbanty
Copy link
Collaborator

dbanty commented Jul 8, 2023

Pretty sure this was fixed by #741

@dbanty dbanty closed this as completed Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants