mirror of https://github.com/tiangolo/fastapi.git
🎨 Auto format
This commit is contained in:
parent
f3d23119f9
commit
e6ed1039c8
|
|
@ -1,5 +1,3 @@
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from fastapi import FastAPI, Security
|
from fastapi import FastAPI, Security
|
||||||
from fastapi.security import OAuth2ClientCredentials
|
from fastapi.security import OAuth2ClientCredentials
|
||||||
from fastapi.testclient import TestClient
|
from fastapi.testclient import TestClient
|
||||||
|
|
@ -14,7 +12,7 @@ oauth2_scheme = OAuth2ClientCredentials(
|
||||||
|
|
||||||
|
|
||||||
@app.get("/items/")
|
@app.get("/items/")
|
||||||
async def read_items(token: Optional[str] = Security(oauth2_scheme)):
|
async def read_items(token: str | None = Security(oauth2_scheme)):
|
||||||
return {"token": token}
|
return {"token": token}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue