Skip to content
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

Interactive docs broken #63

Closed
davidbrochart opened this issue Sep 21, 2021 · 3 comments · Fixed by #64
Closed

Interactive docs broken #63

davidbrochart opened this issue Sep 21, 2021 · 3 comments · Fixed by #64
Labels
bug Something isn't working

Comments

@davidbrochart
Copy link
Collaborator

Description

Interactive documentation is broken because AttributeError: 'NoAuth' object has no attribute 'model'.

Reproduce

  1. Start jupyverse --no-open-browser
  2. Go to http://127.0.0.1:8000/docs
  3. See the error in the termial.

NoAuth should have a "dummy" model, or we should "remove" it from the security schemes.
Any idea @frankie567?

@davidbrochart davidbrochart added the bug Something isn't working label Sep 21, 2021
@davidbrochart
Copy link
Collaborator Author

Setting NoAuthAuthentication's scheme to None would work, but mypy currently fails because it expected a SecurityBase.
Could we make it Optional[SecurityBase] in BaseAuthentication?

@frankie567
Copy link
Contributor

Indeed, I didn't thought about OpenAPI generation. None could be a solution indeed. Could you live with a type: ignore comment?

class NoAuthAuthentication(BaseAuthentication):
    def __init__(self, user: UserDB, name: str = "noauth"):
        super().__init__(name, logout=False)
        self.user = user
        self.scheme = None  # type: ignore

@davidbrochart
Copy link
Collaborator Author

Could you live with a type: ignore comment?

Sure, thanks!

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

Successfully merging a pull request may close this issue.

2 participants