pre-commit-ci-lite[bot]
3 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
5 additions and
7 deletions
-
fastapi/routing.py
-
tests/test_custom_route_class.py
|
|
|
@ -829,8 +829,7 @@ def _accepts_kwarg(cls: type, kwarg: str) -> bool: |
|
|
|
_ACCEPTS_KWARG_CACHE[key] = True |
|
|
|
else: |
|
|
|
_ACCEPTS_KWARG_CACHE[key] = any( |
|
|
|
p.kind == inspect.Parameter.VAR_KEYWORD |
|
|
|
for p in params.values() |
|
|
|
p.kind == inspect.Parameter.VAR_KEYWORD for p in params.values() |
|
|
|
) |
|
|
|
return _ACCEPTS_KWARG_CACHE[key] |
|
|
|
|
|
|
|
|
|
|
|
@ -1,7 +1,8 @@ |
|
|
|
import pytest |
|
|
|
from collections.abc import Callable, Sequence |
|
|
|
from enum import Enum |
|
|
|
from typing import Any, Callable, Sequence |
|
|
|
from typing import Any |
|
|
|
|
|
|
|
import pytest |
|
|
|
from fastapi import APIRouter, FastAPI, params |
|
|
|
from fastapi.datastructures import Default, DefaultPlaceholder |
|
|
|
from fastapi.responses import JSONResponse, Response |
|
|
|
@ -159,9 +160,7 @@ class LegacyRoute(APIRoute): |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: type[Response] | DefaultPlaceholder = Default( |
|
|
|
JSONResponse |
|
|
|
), |
|
|
|
response_class: type[Response] | DefaultPlaceholder = Default(JSONResponse), |
|
|
|
dependency_overrides_provider: Any | None = None, |
|
|
|
callbacks: list[BaseRoute] | None = None, |
|
|
|
openapi_extra: dict[str, Any] | None = None, |
|
|
|
|