Browse Source

Merge b44160d8a1 into 04b279fe77

pull/15109/merge
Tejas Attarde 4 months ago
committed by GitHub
parent
commit
d1feccea92
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      docs_src/query_params_str_validations/tutorial012_an_py310.py
  2. 4
      docs_src/query_params_str_validations/tutorial013_an_py310.py
  3. 4
      fastapi/_compat/v2.py
  4. 2
      scripts/playwright/cookie_param_models/image01.py
  5. 2
      scripts/playwright/header_param_models/image01.py
  6. 2
      scripts/playwright/json_base64_bytes/image01.py
  7. 2
      scripts/playwright/query_param_models/image01.py
  8. 2
      scripts/playwright/request_form_models/image01.py
  9. 2
      scripts/playwright/sql_databases/image01.py
  10. 2
      scripts/playwright/sql_databases/image02.py

4
docs_src/query_params_str_validations/tutorial012_an_py310.py

@ -6,6 +6,8 @@ app = FastAPI()
@app.get("/items/")
async def read_items(q: Annotated[list[str], Query()] = ["foo", "bar"]):
async def read_items(q: Annotated[list[str], Query()] = None):
if q is None:
q = []
query_items = {"q": q}
return query_items

4
docs_src/query_params_str_validations/tutorial013_an_py310.py

@ -6,6 +6,8 @@ app = FastAPI()
@app.get("/items/")
async def read_items(q: Annotated[list, Query()] = []):
async def read_items(q: Annotated[list, Query()] = None):
if q is None:
q = []
query_items = {"q": q}
return query_items

4
fastapi/_compat/v2.py

@ -160,10 +160,12 @@ class ModelField:
def validate(
self,
value: Any,
values: dict[str, Any] = {}, # noqa: B006
values: dict[str, Any] = None, # noqa: B006
*,
loc: tuple[int | str, ...] = (),
) -> tuple[Any, list[dict[str, Any]]]:
if values is None:
values = {}
try:
return (
self._type_adapter.validate_python(value, from_attributes=True),

2
scripts/playwright/cookie_param_models/image01.py

@ -29,7 +29,7 @@ process = subprocess.Popen(
try:
for _ in range(3):
try:
response = httpx.get("http://localhost:8000/docs")
response = httpx.get("http://localhost:8000/docs", timeout=10.0)
except httpx.ConnectError:
time.sleep(1)
break

2
scripts/playwright/header_param_models/image01.py

@ -28,7 +28,7 @@ process = subprocess.Popen(
try:
for _ in range(3):
try:
response = httpx.get("http://localhost:8000/docs")
response = httpx.get("http://localhost:8000/docs", timeout=10.0)
except httpx.ConnectError:
time.sleep(1)
break

2
scripts/playwright/json_base64_bytes/image01.py

@ -27,7 +27,7 @@ process = subprocess.Popen(
try:
for _ in range(3):
try:
response = httpx.get("http://localhost:8000/docs")
response = httpx.get("http://localhost:8000/docs", timeout=10.0)
except httpx.ConnectError:
time.sleep(1)
break

2
scripts/playwright/query_param_models/image01.py

@ -31,7 +31,7 @@ process = subprocess.Popen(
try:
for _ in range(3):
try:
response = httpx.get("http://localhost:8000/docs")
response = httpx.get("http://localhost:8000/docs", timeout=10.0)
except httpx.ConnectError:
time.sleep(1)
break

2
scripts/playwright/request_form_models/image01.py

@ -28,7 +28,7 @@ process = subprocess.Popen(
try:
for _ in range(3):
try:
response = httpx.get("http://localhost:8000/docs")
response = httpx.get("http://localhost:8000/docs", timeout=10.0)
except httpx.ConnectError:
time.sleep(1)
break

2
scripts/playwright/sql_databases/image01.py

@ -27,7 +27,7 @@ process = subprocess.Popen(
try:
for _ in range(3):
try:
response = httpx.get("http://localhost:8000/docs")
response = httpx.get("http://localhost:8000/docs", timeout=10.0)
except httpx.ConnectError:
time.sleep(1)
break

2
scripts/playwright/sql_databases/image02.py

@ -27,7 +27,7 @@ process = subprocess.Popen(
try:
for _ in range(3):
try:
response = httpx.get("http://localhost:8000/docs")
response = httpx.get("http://localhost:8000/docs", timeout=10.0)
except httpx.ConnectError:
time.sleep(1)
break

Loading…
Cancel
Save