fastapi 0.115.0__py3-none-any.whl → 0.115.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fastapi might be problematic. Click here for more details.
- fastapi/__init__.py +1 -1
- fastapi/_compat.py +5 -4
- fastapi/dependencies/utils.py +11 -9
- fastapi/routing.py +3 -1
- fastapi/security/http.py +2 -2
- {fastapi-0.115.0.dist-info → fastapi-0.115.2.dist-info}/METADATA +4 -5
- {fastapi-0.115.0.dist-info → fastapi-0.115.2.dist-info}/RECORD +10 -10
- {fastapi-0.115.0.dist-info → fastapi-0.115.2.dist-info}/WHEEL +1 -1
- {fastapi-0.115.0.dist-info → fastapi-0.115.2.dist-info}/entry_points.txt +2 -0
- {fastapi-0.115.0.dist-info → fastapi-0.115.2.dist-info}/licenses/LICENSE +0 -0
fastapi/__init__.py
CHANGED
fastapi/_compat.py
CHANGED
|
@@ -71,7 +71,7 @@ if PYDANTIC_V2:
|
|
|
71
71
|
general_plain_validator_function as with_info_plain_validator_function, # noqa: F401
|
|
72
72
|
)
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
RequiredParam = PydanticUndefined
|
|
75
75
|
Undefined = PydanticUndefined
|
|
76
76
|
UndefinedType = PydanticUndefinedType
|
|
77
77
|
evaluate_forwardref = eval_type_lenient
|
|
@@ -313,9 +313,10 @@ else:
|
|
|
313
313
|
from pydantic.fields import ( # type: ignore[no-redef,attr-defined]
|
|
314
314
|
ModelField as ModelField, # noqa: F401
|
|
315
315
|
)
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
|
|
317
|
+
# Keeping old "Required" functionality from Pydantic V1, without
|
|
318
|
+
# shadowing typing.Required.
|
|
319
|
+
RequiredParam: Any = Ellipsis # type: ignore[no-redef]
|
|
319
320
|
from pydantic.fields import ( # type: ignore[no-redef,attr-defined]
|
|
320
321
|
Undefined as Undefined,
|
|
321
322
|
)
|
fastapi/dependencies/utils.py
CHANGED
|
@@ -24,7 +24,7 @@ from fastapi._compat import (
|
|
|
24
24
|
PYDANTIC_V2,
|
|
25
25
|
ErrorWrapper,
|
|
26
26
|
ModelField,
|
|
27
|
-
|
|
27
|
+
RequiredParam,
|
|
28
28
|
Undefined,
|
|
29
29
|
_regenerate_error_with_loc,
|
|
30
30
|
copy_field_info,
|
|
@@ -91,14 +91,14 @@ multipart_incorrect_install_error = (
|
|
|
91
91
|
def ensure_multipart_is_installed() -> None:
|
|
92
92
|
try:
|
|
93
93
|
# __version__ is available in both multiparts, and can be mocked
|
|
94
|
-
from multipart import __version__
|
|
94
|
+
from multipart import __version__
|
|
95
95
|
|
|
96
96
|
assert __version__
|
|
97
97
|
try:
|
|
98
98
|
# parse_options_header is only available in the right multipart
|
|
99
|
-
from multipart.multipart import parse_options_header
|
|
99
|
+
from multipart.multipart import parse_options_header
|
|
100
100
|
|
|
101
|
-
assert parse_options_header
|
|
101
|
+
assert parse_options_header # type: ignore[truthy-function]
|
|
102
102
|
except ImportError:
|
|
103
103
|
logger.error(multipart_incorrect_install_error)
|
|
104
104
|
raise RuntimeError(multipart_incorrect_install_error) from None
|
|
@@ -377,7 +377,9 @@ def analyze_param(
|
|
|
377
377
|
field_info = copy_field_info(
|
|
378
378
|
field_info=fastapi_annotation, annotation=use_annotation
|
|
379
379
|
)
|
|
380
|
-
assert
|
|
380
|
+
assert (
|
|
381
|
+
field_info.default is Undefined or field_info.default is RequiredParam
|
|
382
|
+
), (
|
|
381
383
|
f"`{field_info.__class__.__name__}` default value cannot be set in"
|
|
382
384
|
f" `Annotated` for {param_name!r}. Set the default value with `=` instead."
|
|
383
385
|
)
|
|
@@ -385,7 +387,7 @@ def analyze_param(
|
|
|
385
387
|
assert not is_path_param, "Path parameters cannot have default values"
|
|
386
388
|
field_info.default = value
|
|
387
389
|
else:
|
|
388
|
-
field_info.default =
|
|
390
|
+
field_info.default = RequiredParam
|
|
389
391
|
# Get Annotated Depends
|
|
390
392
|
elif isinstance(fastapi_annotation, params.Depends):
|
|
391
393
|
depends = fastapi_annotation
|
|
@@ -434,9 +436,9 @@ def analyze_param(
|
|
|
434
436
|
), f"Cannot specify FastAPI annotation for type {type_annotation!r}"
|
|
435
437
|
# Handle default assignations, neither field_info nor depends was not found in Annotated nor default value
|
|
436
438
|
elif field_info is None and depends is None:
|
|
437
|
-
default_value = value if value is not inspect.Signature.empty else
|
|
439
|
+
default_value = value if value is not inspect.Signature.empty else RequiredParam
|
|
438
440
|
if is_path_param:
|
|
439
|
-
# We might check here that `default_value is
|
|
441
|
+
# We might check here that `default_value is RequiredParam`, but the fact is that the same
|
|
440
442
|
# parameter might sometimes be a path parameter and sometimes not. See
|
|
441
443
|
# `tests/test_infer_param_optionality.py` for an example.
|
|
442
444
|
field_info = params.Path(annotation=use_annotation)
|
|
@@ -480,7 +482,7 @@ def analyze_param(
|
|
|
480
482
|
type_=use_annotation_from_field_info,
|
|
481
483
|
default=field_info.default,
|
|
482
484
|
alias=alias,
|
|
483
|
-
required=field_info.default in (
|
|
485
|
+
required=field_info.default in (RequiredParam, Undefined),
|
|
484
486
|
field_info=field_info,
|
|
485
487
|
)
|
|
486
488
|
if is_path_param:
|
fastapi/routing.py
CHANGED
|
@@ -541,7 +541,9 @@ class APIRoute(routing.Route):
|
|
|
541
541
|
additional_status_code
|
|
542
542
|
), f"Status code {additional_status_code} must not have a response body"
|
|
543
543
|
response_name = f"Response_{additional_status_code}_{self.unique_id}"
|
|
544
|
-
response_field = create_model_field(
|
|
544
|
+
response_field = create_model_field(
|
|
545
|
+
name=response_name, type_=model, mode="serialization"
|
|
546
|
+
)
|
|
545
547
|
response_fields[additional_status_code] = response_field
|
|
546
548
|
if response_fields:
|
|
547
549
|
self.response_fields: Dict[Union[int, str], ModelField] = response_fields
|
fastapi/security/http.py
CHANGED
|
@@ -277,7 +277,7 @@ class HTTPBearer(HTTPBase):
|
|
|
277
277
|
bool,
|
|
278
278
|
Doc(
|
|
279
279
|
"""
|
|
280
|
-
By default, if the HTTP Bearer token not provided (in an
|
|
280
|
+
By default, if the HTTP Bearer token is not provided (in an
|
|
281
281
|
`Authorization` header), `HTTPBearer` will automatically cancel the
|
|
282
282
|
request and send the client an error.
|
|
283
283
|
|
|
@@ -380,7 +380,7 @@ class HTTPDigest(HTTPBase):
|
|
|
380
380
|
bool,
|
|
381
381
|
Doc(
|
|
382
382
|
"""
|
|
383
|
-
By default, if the HTTP Digest not provided, `HTTPDigest` will
|
|
383
|
+
By default, if the HTTP Digest is not provided, `HTTPDigest` will
|
|
384
384
|
automatically cancel the request and send the client an error.
|
|
385
385
|
|
|
386
386
|
If `auto_error` is set to `False`, when the HTTP Digest is not
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fastapi
|
|
3
|
-
Version: 0.115.
|
|
3
|
+
Version: 0.115.2
|
|
4
4
|
Summary: FastAPI framework, high performance, easy to learn, fast to code, ready for production
|
|
5
5
|
Author-Email: =?utf-8?q?Sebasti=C3=A1n_Ram=C3=ADrez?= <tiangolo@gmail.com>
|
|
6
6
|
Classifier: Intended Audience :: Information Technology
|
|
@@ -36,15 +36,17 @@ Project-URL: Repository, https://github.com/fastapi/fastapi
|
|
|
36
36
|
Project-URL: Issues, https://github.com/fastapi/fastapi/issues
|
|
37
37
|
Project-URL: Changelog, https://fastapi.tiangolo.com/release-notes/
|
|
38
38
|
Requires-Python: >=3.8
|
|
39
|
-
Requires-Dist: starlette<0.
|
|
39
|
+
Requires-Dist: starlette<0.41.0,>=0.37.2
|
|
40
40
|
Requires-Dist: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4
|
|
41
41
|
Requires-Dist: typing-extensions>=4.8.0
|
|
42
|
+
Provides-Extra: standard
|
|
42
43
|
Requires-Dist: fastapi-cli[standard]>=0.0.5; extra == "standard"
|
|
43
44
|
Requires-Dist: httpx>=0.23.0; extra == "standard"
|
|
44
45
|
Requires-Dist: jinja2>=2.11.2; extra == "standard"
|
|
45
46
|
Requires-Dist: python-multipart>=0.0.7; extra == "standard"
|
|
46
47
|
Requires-Dist: email-validator>=2.0.0; extra == "standard"
|
|
47
48
|
Requires-Dist: uvicorn[standard]>=0.12.0; extra == "standard"
|
|
49
|
+
Provides-Extra: all
|
|
48
50
|
Requires-Dist: fastapi-cli[standard]>=0.0.5; extra == "all"
|
|
49
51
|
Requires-Dist: httpx>=0.23.0; extra == "all"
|
|
50
52
|
Requires-Dist: jinja2>=2.11.2; extra == "all"
|
|
@@ -57,8 +59,6 @@ Requires-Dist: email-validator>=2.0.0; extra == "all"
|
|
|
57
59
|
Requires-Dist: uvicorn[standard]>=0.12.0; extra == "all"
|
|
58
60
|
Requires-Dist: pydantic-settings>=2.0.0; extra == "all"
|
|
59
61
|
Requires-Dist: pydantic-extra-types>=2.0.0; extra == "all"
|
|
60
|
-
Provides-Extra: standard
|
|
61
|
-
Provides-Extra: all
|
|
62
62
|
Description-Content-Type: text/markdown
|
|
63
63
|
|
|
64
64
|
<p align="center">
|
|
@@ -118,7 +118,6 @@ The key features are:
|
|
|
118
118
|
<a href="https://www.withcoherence.com/?utm_medium=advertising&utm_source=fastapi&utm_campaign=website" target="_blank" title="Coherence"><img src="https://fastapi.tiangolo.com/img/sponsors/coherence.png"></a>
|
|
119
119
|
<a href="https://www.mongodb.com/developer/languages/python/python-quickstart-fastapi/?utm_campaign=fastapi_framework&utm_source=fastapi_sponsorship&utm_medium=web_referral" target="_blank" title="Simplify Full Stack Development with FastAPI & MongoDB"><img src="https://fastapi.tiangolo.com/img/sponsors/mongodb.png"></a>
|
|
120
120
|
<a href="https://zuplo.link/fastapi-gh" target="_blank" title="Zuplo: Scale, Protect, Document, and Monetize your FastAPI"><img src="https://fastapi.tiangolo.com/img/sponsors/zuplo.png"></a>
|
|
121
|
-
<a href="https://fine.dev?ref=fastapibadge" target="_blank" title="Fine's AI FastAPI Workflow: Effortlessly Deploy and Integrate FastAPI into Your Project"><img src="https://fastapi.tiangolo.com/img/sponsors/fine.png"></a>
|
|
122
121
|
<a href="https://liblab.com?utm_source=fastapi" target="_blank" title="liblab - Generate SDKs from FastAPI"><img src="https://fastapi.tiangolo.com/img/sponsors/liblab.png"></a>
|
|
123
122
|
<a href="https://github.com/deepset-ai/haystack/" target="_blank" title="Build powerful search from composable, open source building blocks"><img src="https://fastapi.tiangolo.com/img/sponsors/haystack-fastapi.svg"></a>
|
|
124
123
|
<a href="https://databento.com/" target="_blank" title="Pay as you go for market data"><img src="https://fastapi.tiangolo.com/img/sponsors/databento.svg"></a>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
fastapi-0.115.
|
|
2
|
-
fastapi-0.115.
|
|
3
|
-
fastapi-0.115.
|
|
4
|
-
fastapi-0.115.
|
|
5
|
-
fastapi/__init__.py,sha256=
|
|
1
|
+
fastapi-0.115.2.dist-info/METADATA,sha256=0FGVSmYty-Sk1eUznWoRyN7oRGnSBolz-ZL6HX-jP0Q,27004
|
|
2
|
+
fastapi-0.115.2.dist-info/WHEEL,sha256=pM0IBB6ZwH3nkEPhtcp50KvKNX-07jYtnb1g1m6Z4Co,90
|
|
3
|
+
fastapi-0.115.2.dist-info/entry_points.txt,sha256=GCf-WbIZxyGT4MUmrPGj1cOHYZoGsNPHAvNkT6hnGeA,61
|
|
4
|
+
fastapi-0.115.2.dist-info/licenses/LICENSE,sha256=Tsif_IFIW5f-xYSy1KlhAy7v_oNEU4lP2cEnSQbMdE4,1086
|
|
5
|
+
fastapi/__init__.py,sha256=fiiKZHbsqO8W2WURtSfepLw01eJ0dQMvi9YA1AiXMdk,1081
|
|
6
6
|
fastapi/__main__.py,sha256=bKePXLdO4SsVSM6r9SVoLickJDcR2c0cTOxZRKq26YQ,37
|
|
7
|
-
fastapi/_compat.py,sha256=
|
|
7
|
+
fastapi/_compat.py,sha256=GJTevkAENKrvtvAGL3zDEmzlXaX9EjFzyRPtSfVRCKs,23921
|
|
8
8
|
fastapi/applications.py,sha256=Ix-o9pQAWhEDf9J0Q1hZ0nBB1uP72c-Y3oiYzvrwqiM,176316
|
|
9
9
|
fastapi/background.py,sha256=rouLirxUANrcYC824MSMypXL_Qb2HYg2YZqaiEqbEKI,1768
|
|
10
10
|
fastapi/cli.py,sha256=OYhZb0NR_deuT5ofyPF2NoNBzZDNOP8Salef2nk-HqA,418
|
|
@@ -12,7 +12,7 @@ fastapi/concurrency.py,sha256=AYLnS4judDUmXsNRICtoKSP0prfYDcS8ehBtYW9JhQQ,1403
|
|
|
12
12
|
fastapi/datastructures.py,sha256=b2PEz77XGq-u3Ur1Inwk0AGjOsQZO49yF9C7IPJ15cY,5766
|
|
13
13
|
fastapi/dependencies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
fastapi/dependencies/models.py,sha256=Pjl6vx-4nZ5Tta9kJa3-RfQKkXtCpS09-FhMgs9eWNs,1507
|
|
15
|
-
fastapi/dependencies/utils.py,sha256=
|
|
15
|
+
fastapi/dependencies/utils.py,sha256=os09kCYSbaseQ7MVCdjrZWaTxrpFUTWqDYAYTZ5qt_w,35235
|
|
16
16
|
fastapi/encoders.py,sha256=LvwYmFeOz4tVwvgBoC5rvZnbr7hZr73KGrU8O7zSptU,11068
|
|
17
17
|
fastapi/exception_handlers.py,sha256=MBrIOA-ugjJDivIi4rSsUJBdTsjuzN76q4yh0q1COKw,1332
|
|
18
18
|
fastapi/exceptions.py,sha256=taNixuFEXb67lI1bnX1ubq8y8TseJ4yoPlWjyP0fTzk,4969
|
|
@@ -33,11 +33,11 @@ fastapi/params.py,sha256=XC025dCSObp7fXhOPYo-jwXQRGZ9CwlfNRq2cLh_dRk,28186
|
|
|
33
33
|
fastapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
fastapi/requests.py,sha256=zayepKFcienBllv3snmWI20Gk0oHNVLU4DDhqXBb4LU,142
|
|
35
35
|
fastapi/responses.py,sha256=QNQQlwpKhQoIPZTTWkpc9d_QGeGZ_aVQPaDV3nQ8m7c,1761
|
|
36
|
-
fastapi/routing.py,sha256=
|
|
36
|
+
fastapi/routing.py,sha256=WK06IwZeyRwxkdB4uHZ7JXinxtVOxM8Ke0tqHaDOvYA,176208
|
|
37
37
|
fastapi/security/__init__.py,sha256=bO8pNmxqVRXUjfl2mOKiVZLn0FpBQ61VUYVjmppnbJw,881
|
|
38
38
|
fastapi/security/api_key.py,sha256=_OqUUjEHG5_MT1IPAhXIGJRCPldTBdSww_DegFy_W8Y,9368
|
|
39
39
|
fastapi/security/base.py,sha256=dl4pvbC-RxjfbWgPtCWd8MVU-7CB2SZ22rJDXVCXO6c,141
|
|
40
|
-
fastapi/security/http.py,sha256=
|
|
40
|
+
fastapi/security/http.py,sha256=223bAV_d7NjI57Pzhbd_KlQTYlMyr5MoN1TW80rbxF8,13512
|
|
41
41
|
fastapi/security/oauth2.py,sha256=lWemX4CLAvanR6-jiQxFtOyHjHbzEnNbpytA_WXgZcw,21583
|
|
42
42
|
fastapi/security/open_id_connect_url.py,sha256=8vizZ2tGqEp1ur8SwtVgyHJhGAJ5AqahgcvSpaIioDI,2722
|
|
43
43
|
fastapi/security/utils.py,sha256=bd8T0YM7UQD5ATKucr1bNtAvz_Y3__dVNAv5UebiPvc,293
|
|
@@ -47,4 +47,4 @@ fastapi/testclient.py,sha256=nBvaAmX66YldReJNZXPOk1sfuo2Q6hs8bOvIaCep6LQ,66
|
|
|
47
47
|
fastapi/types.py,sha256=nFb36sK3DSoqoyo7Miwy3meKK5UdFBgkAgLSzQlUVyI,383
|
|
48
48
|
fastapi/utils.py,sha256=y8Bj5ttMaI9tS4D60OUgXqKnktBr99NdYUnHHV9LgoY,7948
|
|
49
49
|
fastapi/websockets.py,sha256=419uncYObEKZG0YcrXscfQQYLSWoE10jqxVMetGdR98,222
|
|
50
|
-
fastapi-0.115.
|
|
50
|
+
fastapi-0.115.2.dist-info/RECORD,,
|
|
File without changes
|