[BUG] Missing autocompletion for request.app
See original GitHub issueDescribe the bug
When I am using the request
instance in an endpoint, my IDE does not provide me with autocompletion for request.app
.
Is it maybe due to missing type hints? Or because the request instance is from Starlette and cannot be annotated in FastAPI?
To Reproduce Steps to reproduce the behavior:
- Create a file with
from fastapi import FastAPI
from starlette.requests import Request
app = FastAPI()
@app.get('/')
def get(request: Request):
request.app
- Try to run autocompletion for request.app
Expected behavior I can use the auto-completion provided by me IDE (e.g. PyCharm)
Screenshots n/a
Environment:
-
OS: macOS
-
FastAPI Version: 0.42
-
Python version: 3.7.4
Additional context
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Xcode 13 autocomplete issues with overrides - Apple Developer
Let's say we are using UIViewController, and we are trying to override viewDidAppear. Typing viewDidAppear to override should get me the full function...
Read more >Android Studio - Auto complete and other features not working
#1 From Build menu (of your Android Studio), click Rebuild Project option. #2 Then once rebuild completes, go to File > Invalidate Caches...
Read more >Bug: Auto-complete doesn't work for Java in eclipse 2021-03
So I fixed the ini file. But autocomplete doesn't work. The first time I try it I get a popup that has just...
Read more >How to turn off form autocompletion - Web security | MDN
This article explains how a website can disable autocomplete for form fields.
Read more >370363 - autofill for forms not deactivatable - chromium
If the passwordfield is the first field in the form, it does not trigger. The form is even autofilled after adding autocomplete="off" into...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had two use cases for accessing fields of the
app
instance in a path operationThis would be solved by your suggestion to extract these values into a settings object.
I guess your same suggestion would apply here.
I am fine with that and I missed the proposed options when creating the issue.
Great! Thanks for replying back @chbndrhnns . Then I think we can close this issue, right?