The following issues were found
docs_src/response_status_code/tutorial001.py
3 issues
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.post("/items/", status_code=201)
async def create_item(name: str):
return {"name": name}
Reported by Pylint.
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.post("/items/", status_code=201)
async def create_item(name: str):
return {"name": name}
Reported by Pylint.
Line: 7
Column: 1
@app.post("/items/", status_code=201)
async def create_item(name: str):
return {"name": name}
Reported by Pylint.
docs_src/cookie_params/tutorial001.py
3 issues
Line: 3
Column: 1
from typing import Optional
from fastapi import Cookie, FastAPI
app = FastAPI()
@app.get("/items/")
async def read_items(ads_id: Optional[str] = Cookie(None)):
Reported by Pylint.
Line: 1
Column: 1
from typing import Optional
from fastapi import Cookie, FastAPI
app = FastAPI()
@app.get("/items/")
async def read_items(ads_id: Optional[str] = Cookie(None)):
Reported by Pylint.
Line: 9
Column: 1
@app.get("/items/")
async def read_items(ads_id: Optional[str] = Cookie(None)):
return {"ads_id": ads_id}
Reported by Pylint.
docs_src/path_params/tutorial001.py
3 issues
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_item(item_id):
return {"item_id": item_id}
Reported by Pylint.
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_item(item_id):
return {"item_id": item_id}
Reported by Pylint.
Line: 7
Column: 1
@app.get("/items/{item_id}")
async def read_item(item_id):
return {"item_id": item_id}
Reported by Pylint.
docs_src/body_nested_models/tutorial009.py
3 issues
Line: 3
Column: 1
from typing import Dict
from fastapi import FastAPI
app = FastAPI()
@app.post("/index-weights/")
async def create_index_weights(weights: Dict[int, float]):
Reported by Pylint.
Line: 1
Column: 1
from typing import Dict
from fastapi import FastAPI
app = FastAPI()
@app.post("/index-weights/")
async def create_index_weights(weights: Dict[int, float]):
Reported by Pylint.
Line: 9
Column: 1
@app.post("/index-weights/")
async def create_index_weights(weights: Dict[int, float]):
return weights
Reported by Pylint.
docs_src/path_params/tutorial002.py
3 issues
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_item(item_id: int):
return {"item_id": item_id}
Reported by Pylint.
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_item(item_id: int):
return {"item_id": item_id}
Reported by Pylint.
Line: 7
Column: 1
@app.get("/items/{item_id}")
async def read_item(item_id: int):
return {"item_id": item_id}
Reported by Pylint.
docs_src/path_params/tutorial004.py
3 issues
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.get("/files/{file_path:path}")
async def read_file(file_path: str):
return {"file_path": file_path}
Reported by Pylint.
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.get("/files/{file_path:path}")
async def read_file(file_path: str):
return {"file_path": file_path}
Reported by Pylint.
Line: 7
Column: 1
@app.get("/files/{file_path:path}")
async def read_file(file_path: str):
return {"file_path": file_path}
Reported by Pylint.
fastapi/middleware/__init__.py
3 issues
Line: 1
Column: 1
from starlette.middleware import Middleware as Middleware
Reported by Pylint.
Line: 1
Column: 1
from starlette.middleware import Middleware as Middleware
Reported by Pylint.
Line: 1
Column: 1
from starlette.middleware import Middleware as Middleware
Reported by Pylint.
docs_src/query_params/tutorial001.py
3 issues
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
@app.get("/items/")
async def read_item(skip: int = 0, limit: int = 10):
Reported by Pylint.
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
@app.get("/items/")
async def read_item(skip: int = 0, limit: int = 10):
Reported by Pylint.
Line: 9
Column: 1
@app.get("/items/")
async def read_item(skip: int = 0, limit: int = 10):
return fake_items_db[skip : skip + limit]
Reported by Pylint.
docs_src/query_params/tutorial005.py
3 issues
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_user_item(item_id: str, needy: str):
item = {"item_id": item_id, "needy": needy}
return item
Reported by Pylint.
Line: 1
Column: 1
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_user_item(item_id: str, needy: str):
item = {"item_id": item_id, "needy": needy}
return item
Reported by Pylint.
Line: 7
Column: 1
@app.get("/items/{item_id}")
async def read_user_item(item_id: str, needy: str):
item = {"item_id": item_id, "needy": needy}
return item
Reported by Pylint.
docs_src/query_params/tutorial006.py
3 issues
Line: 3
Column: 1
from typing import Optional
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_user_item(
Reported by Pylint.
Line: 1
Column: 1
from typing import Optional
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_user_item(
Reported by Pylint.
Line: 9
Column: 1
@app.get("/items/{item_id}")
async def read_user_item(
item_id: str, needy: str, skip: int = 0, limit: Optional[int] = None
):
item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit}
return item
Reported by Pylint.