Skip to content

Improve Requestish type #114

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

Merged
merged 2 commits into from
Apr 22, 2025
Merged

Improve Requestish type #114

merged 2 commits into from
Apr 22, 2025

Conversation

tomgrin10
Copy link
Contributor

Currently certain type checkers don't accept usage of fastapi's Request as an argument for authenticate_request because of a type discrepancy.
The error I'm getting with basedpyright is this:

Argument of type "Request" cannot be assigned to parameter "request" of type "Requestish" in function "authenticate_request"
  "Request" is incompatible with protocol "Requestish"
    "headers" is invariant because it is mutable
    "headers" is an incompatible type
      "property" is not assignable to "Dict[str, str]"

I changed the Requestish type to be more correct to its usage.
There are no checker linter warnings now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants