fastapi 0.101.1__py3-none-any.whl → 0.103.0__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 +13 -2
- fastapi/applications.py +3 -0
- fastapi/openapi/models.py +8 -8
- fastapi/openapi/utils.py +22 -2
- fastapi/param_functions.py +15 -0
- fastapi/params.py +17 -0
- {fastapi-0.101.1.dist-info → fastapi-0.103.0.dist-info}/METADATA +3 -1
- {fastapi-0.101.1.dist-info → fastapi-0.103.0.dist-info}/RECORD +11 -11
- {fastapi-0.101.1.dist-info → fastapi-0.103.0.dist-info}/WHEEL +0 -0
- {fastapi-0.101.1.dist-info → fastapi-0.103.0.dist-info}/licenses/LICENSE +0 -0
fastapi/__init__.py
CHANGED
fastapi/_compat.py
CHANGED
|
@@ -181,9 +181,13 @@ if PYDANTIC_V2:
|
|
|
181
181
|
field_mapping: Dict[
|
|
182
182
|
Tuple[ModelField, Literal["validation", "serialization"]], JsonSchemaValue
|
|
183
183
|
],
|
|
184
|
+
separate_input_output_schemas: bool = True,
|
|
184
185
|
) -> Dict[str, Any]:
|
|
186
|
+
override_mode: Union[Literal["validation"], None] = (
|
|
187
|
+
None if separate_input_output_schemas else "validation"
|
|
188
|
+
)
|
|
185
189
|
# This expects that GenerateJsonSchema was already used to generate the definitions
|
|
186
|
-
json_schema = field_mapping[(field, field.mode)]
|
|
190
|
+
json_schema = field_mapping[(field, override_mode or field.mode)]
|
|
187
191
|
if "$ref" not in json_schema:
|
|
188
192
|
# TODO remove when deprecating Pydantic v1
|
|
189
193
|
# Ref: https://github.com/pydantic/pydantic/blob/d61792cc42c80b13b23e3ffa74bc37ec7c77f7d1/pydantic/schema.py#L207
|
|
@@ -200,14 +204,19 @@ if PYDANTIC_V2:
|
|
|
200
204
|
fields: List[ModelField],
|
|
201
205
|
schema_generator: GenerateJsonSchema,
|
|
202
206
|
model_name_map: ModelNameMap,
|
|
207
|
+
separate_input_output_schemas: bool = True,
|
|
203
208
|
) -> Tuple[
|
|
204
209
|
Dict[
|
|
205
210
|
Tuple[ModelField, Literal["validation", "serialization"]], JsonSchemaValue
|
|
206
211
|
],
|
|
207
212
|
Dict[str, Dict[str, Any]],
|
|
208
213
|
]:
|
|
214
|
+
override_mode: Union[Literal["validation"], None] = (
|
|
215
|
+
None if separate_input_output_schemas else "validation"
|
|
216
|
+
)
|
|
209
217
|
inputs = [
|
|
210
|
-
(field, field.mode, field._type_adapter.core_schema)
|
|
218
|
+
(field, override_mode or field.mode, field._type_adapter.core_schema)
|
|
219
|
+
for field in fields
|
|
211
220
|
]
|
|
212
221
|
field_mapping, definitions = schema_generator.generate_definitions(
|
|
213
222
|
inputs=inputs
|
|
@@ -429,6 +438,7 @@ else:
|
|
|
429
438
|
field_mapping: Dict[
|
|
430
439
|
Tuple[ModelField, Literal["validation", "serialization"]], JsonSchemaValue
|
|
431
440
|
],
|
|
441
|
+
separate_input_output_schemas: bool = True,
|
|
432
442
|
) -> Dict[str, Any]:
|
|
433
443
|
# This expects that GenerateJsonSchema was already used to generate the definitions
|
|
434
444
|
return field_schema( # type: ignore[no-any-return]
|
|
@@ -444,6 +454,7 @@ else:
|
|
|
444
454
|
fields: List[ModelField],
|
|
445
455
|
schema_generator: GenerateJsonSchema,
|
|
446
456
|
model_name_map: ModelNameMap,
|
|
457
|
+
separate_input_output_schemas: bool = True,
|
|
447
458
|
) -> Tuple[
|
|
448
459
|
Dict[
|
|
449
460
|
Tuple[ModelField, Literal["validation", "serialization"]], JsonSchemaValue
|
fastapi/applications.py
CHANGED
|
@@ -92,6 +92,7 @@ class FastAPI(Starlette):
|
|
|
92
92
|
generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(
|
|
93
93
|
generate_unique_id
|
|
94
94
|
),
|
|
95
|
+
separate_input_output_schemas: bool = True,
|
|
95
96
|
**extra: Any,
|
|
96
97
|
) -> None:
|
|
97
98
|
self.debug = debug
|
|
@@ -111,6 +112,7 @@ class FastAPI(Starlette):
|
|
|
111
112
|
self.swagger_ui_init_oauth = swagger_ui_init_oauth
|
|
112
113
|
self.swagger_ui_parameters = swagger_ui_parameters
|
|
113
114
|
self.servers = servers or []
|
|
115
|
+
self.separate_input_output_schemas = separate_input_output_schemas
|
|
114
116
|
self.extra = extra
|
|
115
117
|
self.openapi_version = "3.1.0"
|
|
116
118
|
self.openapi_schema: Optional[Dict[str, Any]] = None
|
|
@@ -227,6 +229,7 @@ class FastAPI(Starlette):
|
|
|
227
229
|
webhooks=self.webhooks.routes,
|
|
228
230
|
tags=self.openapi_tags,
|
|
229
231
|
servers=self.servers,
|
|
232
|
+
separate_input_output_schemas=self.separate_input_output_schemas,
|
|
230
233
|
)
|
|
231
234
|
return self.openapi_schema
|
|
232
235
|
|
fastapi/openapi/models.py
CHANGED
|
@@ -11,7 +11,7 @@ from fastapi._compat import (
|
|
|
11
11
|
)
|
|
12
12
|
from fastapi.logger import logger
|
|
13
13
|
from pydantic import AnyUrl, BaseModel, Field
|
|
14
|
-
from typing_extensions import Annotated, Literal
|
|
14
|
+
from typing_extensions import Annotated, Literal, TypedDict
|
|
15
15
|
from typing_extensions import deprecated as typing_deprecated
|
|
16
16
|
|
|
17
17
|
try:
|
|
@@ -267,14 +267,14 @@ class Schema(BaseModel):
|
|
|
267
267
|
SchemaOrBool = Union[Schema, bool]
|
|
268
268
|
|
|
269
269
|
|
|
270
|
-
class Example(
|
|
271
|
-
summary: Optional[str]
|
|
272
|
-
description: Optional[str]
|
|
273
|
-
value: Optional[Any]
|
|
274
|
-
externalValue: Optional[AnyUrl]
|
|
270
|
+
class Example(TypedDict, total=False):
|
|
271
|
+
summary: Optional[str]
|
|
272
|
+
description: Optional[str]
|
|
273
|
+
value: Optional[Any]
|
|
274
|
+
externalValue: Optional[AnyUrl]
|
|
275
275
|
|
|
276
|
-
if PYDANTIC_V2:
|
|
277
|
-
|
|
276
|
+
if PYDANTIC_V2: # type: ignore [misc]
|
|
277
|
+
__pydantic_config__ = {"extra": "allow"}
|
|
278
278
|
|
|
279
279
|
else:
|
|
280
280
|
|
fastapi/openapi/utils.py
CHANGED
|
@@ -95,6 +95,7 @@ def get_openapi_operation_parameters(
|
|
|
95
95
|
field_mapping: Dict[
|
|
96
96
|
Tuple[ModelField, Literal["validation", "serialization"]], JsonSchemaValue
|
|
97
97
|
],
|
|
98
|
+
separate_input_output_schemas: bool = True,
|
|
98
99
|
) -> List[Dict[str, Any]]:
|
|
99
100
|
parameters = []
|
|
100
101
|
for param in all_route_params:
|
|
@@ -107,6 +108,7 @@ def get_openapi_operation_parameters(
|
|
|
107
108
|
schema_generator=schema_generator,
|
|
108
109
|
model_name_map=model_name_map,
|
|
109
110
|
field_mapping=field_mapping,
|
|
111
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
110
112
|
)
|
|
111
113
|
parameter = {
|
|
112
114
|
"name": param.alias,
|
|
@@ -116,7 +118,9 @@ def get_openapi_operation_parameters(
|
|
|
116
118
|
}
|
|
117
119
|
if field_info.description:
|
|
118
120
|
parameter["description"] = field_info.description
|
|
119
|
-
if field_info.
|
|
121
|
+
if field_info.openapi_examples:
|
|
122
|
+
parameter["examples"] = jsonable_encoder(field_info.openapi_examples)
|
|
123
|
+
elif field_info.example != Undefined:
|
|
120
124
|
parameter["example"] = jsonable_encoder(field_info.example)
|
|
121
125
|
if field_info.deprecated:
|
|
122
126
|
parameter["deprecated"] = field_info.deprecated
|
|
@@ -132,6 +136,7 @@ def get_openapi_operation_request_body(
|
|
|
132
136
|
field_mapping: Dict[
|
|
133
137
|
Tuple[ModelField, Literal["validation", "serialization"]], JsonSchemaValue
|
|
134
138
|
],
|
|
139
|
+
separate_input_output_schemas: bool = True,
|
|
135
140
|
) -> Optional[Dict[str, Any]]:
|
|
136
141
|
if not body_field:
|
|
137
142
|
return None
|
|
@@ -141,6 +146,7 @@ def get_openapi_operation_request_body(
|
|
|
141
146
|
schema_generator=schema_generator,
|
|
142
147
|
model_name_map=model_name_map,
|
|
143
148
|
field_mapping=field_mapping,
|
|
149
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
144
150
|
)
|
|
145
151
|
field_info = cast(Body, body_field.field_info)
|
|
146
152
|
request_media_type = field_info.media_type
|
|
@@ -149,7 +155,11 @@ def get_openapi_operation_request_body(
|
|
|
149
155
|
if required:
|
|
150
156
|
request_body_oai["required"] = required
|
|
151
157
|
request_media_content: Dict[str, Any] = {"schema": body_schema}
|
|
152
|
-
if field_info.
|
|
158
|
+
if field_info.openapi_examples:
|
|
159
|
+
request_media_content["examples"] = jsonable_encoder(
|
|
160
|
+
field_info.openapi_examples
|
|
161
|
+
)
|
|
162
|
+
elif field_info.example != Undefined:
|
|
153
163
|
request_media_content["example"] = jsonable_encoder(field_info.example)
|
|
154
164
|
request_body_oai["content"] = {request_media_type: request_media_content}
|
|
155
165
|
return request_body_oai
|
|
@@ -211,6 +221,7 @@ def get_openapi_path(
|
|
|
211
221
|
field_mapping: Dict[
|
|
212
222
|
Tuple[ModelField, Literal["validation", "serialization"]], JsonSchemaValue
|
|
213
223
|
],
|
|
224
|
+
separate_input_output_schemas: bool = True,
|
|
214
225
|
) -> Tuple[Dict[str, Any], Dict[str, Any], Dict[str, Any]]:
|
|
215
226
|
path = {}
|
|
216
227
|
security_schemes: Dict[str, Any] = {}
|
|
@@ -242,6 +253,7 @@ def get_openapi_path(
|
|
|
242
253
|
schema_generator=schema_generator,
|
|
243
254
|
model_name_map=model_name_map,
|
|
244
255
|
field_mapping=field_mapping,
|
|
256
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
245
257
|
)
|
|
246
258
|
parameters.extend(operation_parameters)
|
|
247
259
|
if parameters:
|
|
@@ -263,6 +275,7 @@ def get_openapi_path(
|
|
|
263
275
|
schema_generator=schema_generator,
|
|
264
276
|
model_name_map=model_name_map,
|
|
265
277
|
field_mapping=field_mapping,
|
|
278
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
266
279
|
)
|
|
267
280
|
if request_body_oai:
|
|
268
281
|
operation["requestBody"] = request_body_oai
|
|
@@ -280,6 +293,7 @@ def get_openapi_path(
|
|
|
280
293
|
schema_generator=schema_generator,
|
|
281
294
|
model_name_map=model_name_map,
|
|
282
295
|
field_mapping=field_mapping,
|
|
296
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
283
297
|
)
|
|
284
298
|
callbacks[callback.name] = {callback.path: cb_path}
|
|
285
299
|
operation["callbacks"] = callbacks
|
|
@@ -310,6 +324,7 @@ def get_openapi_path(
|
|
|
310
324
|
schema_generator=schema_generator,
|
|
311
325
|
model_name_map=model_name_map,
|
|
312
326
|
field_mapping=field_mapping,
|
|
327
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
313
328
|
)
|
|
314
329
|
else:
|
|
315
330
|
response_schema = {}
|
|
@@ -343,6 +358,7 @@ def get_openapi_path(
|
|
|
343
358
|
schema_generator=schema_generator,
|
|
344
359
|
model_name_map=model_name_map,
|
|
345
360
|
field_mapping=field_mapping,
|
|
361
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
346
362
|
)
|
|
347
363
|
media_type = route_response_media_type or "application/json"
|
|
348
364
|
additional_schema = (
|
|
@@ -433,6 +449,7 @@ def get_openapi(
|
|
|
433
449
|
terms_of_service: Optional[str] = None,
|
|
434
450
|
contact: Optional[Dict[str, Union[str, Any]]] = None,
|
|
435
451
|
license_info: Optional[Dict[str, Union[str, Any]]] = None,
|
|
452
|
+
separate_input_output_schemas: bool = True,
|
|
436
453
|
) -> Dict[str, Any]:
|
|
437
454
|
info: Dict[str, Any] = {"title": title, "version": version}
|
|
438
455
|
if summary:
|
|
@@ -459,6 +476,7 @@ def get_openapi(
|
|
|
459
476
|
fields=all_fields,
|
|
460
477
|
schema_generator=schema_generator,
|
|
461
478
|
model_name_map=model_name_map,
|
|
479
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
462
480
|
)
|
|
463
481
|
for route in routes or []:
|
|
464
482
|
if isinstance(route, routing.APIRoute):
|
|
@@ -468,6 +486,7 @@ def get_openapi(
|
|
|
468
486
|
schema_generator=schema_generator,
|
|
469
487
|
model_name_map=model_name_map,
|
|
470
488
|
field_mapping=field_mapping,
|
|
489
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
471
490
|
)
|
|
472
491
|
if result:
|
|
473
492
|
path, security_schemes, path_definitions = result
|
|
@@ -487,6 +506,7 @@ def get_openapi(
|
|
|
487
506
|
schema_generator=schema_generator,
|
|
488
507
|
model_name_map=model_name_map,
|
|
489
508
|
field_mapping=field_mapping,
|
|
509
|
+
separate_input_output_schemas=separate_input_output_schemas,
|
|
490
510
|
)
|
|
491
511
|
if result:
|
|
492
512
|
path, security_schemes, path_definitions = result
|
fastapi/param_functions.py
CHANGED
|
@@ -2,6 +2,7 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Union
|
|
|
2
2
|
|
|
3
3
|
from fastapi import params
|
|
4
4
|
from fastapi._compat import Undefined
|
|
5
|
+
from fastapi.openapi.models import Example
|
|
5
6
|
from typing_extensions import Annotated, deprecated
|
|
6
7
|
|
|
7
8
|
_Unset: Any = Undefined
|
|
@@ -46,6 +47,7 @@ def Path( # noqa: N802
|
|
|
46
47
|
"although still supported. Use examples instead."
|
|
47
48
|
),
|
|
48
49
|
] = _Unset,
|
|
50
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
49
51
|
deprecated: Optional[bool] = None,
|
|
50
52
|
include_in_schema: bool = True,
|
|
51
53
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -76,6 +78,7 @@ def Path( # noqa: N802
|
|
|
76
78
|
decimal_places=decimal_places,
|
|
77
79
|
example=example,
|
|
78
80
|
examples=examples,
|
|
81
|
+
openapi_examples=openapi_examples,
|
|
79
82
|
deprecated=deprecated,
|
|
80
83
|
include_in_schema=include_in_schema,
|
|
81
84
|
json_schema_extra=json_schema_extra,
|
|
@@ -122,6 +125,7 @@ def Query( # noqa: N802
|
|
|
122
125
|
"although still supported. Use examples instead."
|
|
123
126
|
),
|
|
124
127
|
] = _Unset,
|
|
128
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
125
129
|
deprecated: Optional[bool] = None,
|
|
126
130
|
include_in_schema: bool = True,
|
|
127
131
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -152,6 +156,7 @@ def Query( # noqa: N802
|
|
|
152
156
|
decimal_places=decimal_places,
|
|
153
157
|
example=example,
|
|
154
158
|
examples=examples,
|
|
159
|
+
openapi_examples=openapi_examples,
|
|
155
160
|
deprecated=deprecated,
|
|
156
161
|
include_in_schema=include_in_schema,
|
|
157
162
|
json_schema_extra=json_schema_extra,
|
|
@@ -199,6 +204,7 @@ def Header( # noqa: N802
|
|
|
199
204
|
"although still supported. Use examples instead."
|
|
200
205
|
),
|
|
201
206
|
] = _Unset,
|
|
207
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
202
208
|
deprecated: Optional[bool] = None,
|
|
203
209
|
include_in_schema: bool = True,
|
|
204
210
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -230,6 +236,7 @@ def Header( # noqa: N802
|
|
|
230
236
|
decimal_places=decimal_places,
|
|
231
237
|
example=example,
|
|
232
238
|
examples=examples,
|
|
239
|
+
openapi_examples=openapi_examples,
|
|
233
240
|
deprecated=deprecated,
|
|
234
241
|
include_in_schema=include_in_schema,
|
|
235
242
|
json_schema_extra=json_schema_extra,
|
|
@@ -276,6 +283,7 @@ def Cookie( # noqa: N802
|
|
|
276
283
|
"although still supported. Use examples instead."
|
|
277
284
|
),
|
|
278
285
|
] = _Unset,
|
|
286
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
279
287
|
deprecated: Optional[bool] = None,
|
|
280
288
|
include_in_schema: bool = True,
|
|
281
289
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -306,6 +314,7 @@ def Cookie( # noqa: N802
|
|
|
306
314
|
decimal_places=decimal_places,
|
|
307
315
|
example=example,
|
|
308
316
|
examples=examples,
|
|
317
|
+
openapi_examples=openapi_examples,
|
|
309
318
|
deprecated=deprecated,
|
|
310
319
|
include_in_schema=include_in_schema,
|
|
311
320
|
json_schema_extra=json_schema_extra,
|
|
@@ -354,6 +363,7 @@ def Body( # noqa: N802
|
|
|
354
363
|
"although still supported. Use examples instead."
|
|
355
364
|
),
|
|
356
365
|
] = _Unset,
|
|
366
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
357
367
|
deprecated: Optional[bool] = None,
|
|
358
368
|
include_in_schema: bool = True,
|
|
359
369
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -386,6 +396,7 @@ def Body( # noqa: N802
|
|
|
386
396
|
decimal_places=decimal_places,
|
|
387
397
|
example=example,
|
|
388
398
|
examples=examples,
|
|
399
|
+
openapi_examples=openapi_examples,
|
|
389
400
|
deprecated=deprecated,
|
|
390
401
|
include_in_schema=include_in_schema,
|
|
391
402
|
json_schema_extra=json_schema_extra,
|
|
@@ -433,6 +444,7 @@ def Form( # noqa: N802
|
|
|
433
444
|
"although still supported. Use examples instead."
|
|
434
445
|
),
|
|
435
446
|
] = _Unset,
|
|
447
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
436
448
|
deprecated: Optional[bool] = None,
|
|
437
449
|
include_in_schema: bool = True,
|
|
438
450
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -464,6 +476,7 @@ def Form( # noqa: N802
|
|
|
464
476
|
decimal_places=decimal_places,
|
|
465
477
|
example=example,
|
|
466
478
|
examples=examples,
|
|
479
|
+
openapi_examples=openapi_examples,
|
|
467
480
|
deprecated=deprecated,
|
|
468
481
|
include_in_schema=include_in_schema,
|
|
469
482
|
json_schema_extra=json_schema_extra,
|
|
@@ -511,6 +524,7 @@ def File( # noqa: N802
|
|
|
511
524
|
"although still supported. Use examples instead."
|
|
512
525
|
),
|
|
513
526
|
] = _Unset,
|
|
527
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
514
528
|
deprecated: Optional[bool] = None,
|
|
515
529
|
include_in_schema: bool = True,
|
|
516
530
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -542,6 +556,7 @@ def File( # noqa: N802
|
|
|
542
556
|
decimal_places=decimal_places,
|
|
543
557
|
example=example,
|
|
544
558
|
examples=examples,
|
|
559
|
+
openapi_examples=openapi_examples,
|
|
545
560
|
deprecated=deprecated,
|
|
546
561
|
include_in_schema=include_in_schema,
|
|
547
562
|
json_schema_extra=json_schema_extra,
|
fastapi/params.py
CHANGED
|
@@ -2,6 +2,7 @@ import warnings
|
|
|
2
2
|
from enum import Enum
|
|
3
3
|
from typing import Any, Callable, Dict, List, Optional, Sequence, Union
|
|
4
4
|
|
|
5
|
+
from fastapi.openapi.models import Example
|
|
5
6
|
from pydantic.fields import FieldInfo
|
|
6
7
|
from typing_extensions import Annotated, deprecated
|
|
7
8
|
|
|
@@ -61,6 +62,7 @@ class Param(FieldInfo):
|
|
|
61
62
|
"although still supported. Use examples instead."
|
|
62
63
|
),
|
|
63
64
|
] = _Unset,
|
|
65
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
64
66
|
deprecated: Optional[bool] = None,
|
|
65
67
|
include_in_schema: bool = True,
|
|
66
68
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -75,6 +77,7 @@ class Param(FieldInfo):
|
|
|
75
77
|
)
|
|
76
78
|
self.example = example
|
|
77
79
|
self.include_in_schema = include_in_schema
|
|
80
|
+
self.openapi_examples = openapi_examples
|
|
78
81
|
kwargs = dict(
|
|
79
82
|
default=default,
|
|
80
83
|
default_factory=default_factory,
|
|
@@ -170,6 +173,7 @@ class Path(Param):
|
|
|
170
173
|
"although still supported. Use examples instead."
|
|
171
174
|
),
|
|
172
175
|
] = _Unset,
|
|
176
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
173
177
|
deprecated: Optional[bool] = None,
|
|
174
178
|
include_in_schema: bool = True,
|
|
175
179
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -204,6 +208,7 @@ class Path(Param):
|
|
|
204
208
|
deprecated=deprecated,
|
|
205
209
|
example=example,
|
|
206
210
|
examples=examples,
|
|
211
|
+
openapi_examples=openapi_examples,
|
|
207
212
|
include_in_schema=include_in_schema,
|
|
208
213
|
json_schema_extra=json_schema_extra,
|
|
209
214
|
**extra,
|
|
@@ -254,6 +259,7 @@ class Query(Param):
|
|
|
254
259
|
"although still supported. Use examples instead."
|
|
255
260
|
),
|
|
256
261
|
] = _Unset,
|
|
262
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
257
263
|
deprecated: Optional[bool] = None,
|
|
258
264
|
include_in_schema: bool = True,
|
|
259
265
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -286,6 +292,7 @@ class Query(Param):
|
|
|
286
292
|
deprecated=deprecated,
|
|
287
293
|
example=example,
|
|
288
294
|
examples=examples,
|
|
295
|
+
openapi_examples=openapi_examples,
|
|
289
296
|
include_in_schema=include_in_schema,
|
|
290
297
|
json_schema_extra=json_schema_extra,
|
|
291
298
|
**extra,
|
|
@@ -337,6 +344,7 @@ class Header(Param):
|
|
|
337
344
|
"although still supported. Use examples instead."
|
|
338
345
|
),
|
|
339
346
|
] = _Unset,
|
|
347
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
340
348
|
deprecated: Optional[bool] = None,
|
|
341
349
|
include_in_schema: bool = True,
|
|
342
350
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -370,6 +378,7 @@ class Header(Param):
|
|
|
370
378
|
deprecated=deprecated,
|
|
371
379
|
example=example,
|
|
372
380
|
examples=examples,
|
|
381
|
+
openapi_examples=openapi_examples,
|
|
373
382
|
include_in_schema=include_in_schema,
|
|
374
383
|
json_schema_extra=json_schema_extra,
|
|
375
384
|
**extra,
|
|
@@ -420,6 +429,7 @@ class Cookie(Param):
|
|
|
420
429
|
"although still supported. Use examples instead."
|
|
421
430
|
),
|
|
422
431
|
] = _Unset,
|
|
432
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
423
433
|
deprecated: Optional[bool] = None,
|
|
424
434
|
include_in_schema: bool = True,
|
|
425
435
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -452,6 +462,7 @@ class Cookie(Param):
|
|
|
452
462
|
deprecated=deprecated,
|
|
453
463
|
example=example,
|
|
454
464
|
examples=examples,
|
|
465
|
+
openapi_examples=openapi_examples,
|
|
455
466
|
include_in_schema=include_in_schema,
|
|
456
467
|
json_schema_extra=json_schema_extra,
|
|
457
468
|
**extra,
|
|
@@ -502,6 +513,7 @@ class Body(FieldInfo):
|
|
|
502
513
|
"although still supported. Use examples instead."
|
|
503
514
|
),
|
|
504
515
|
] = _Unset,
|
|
516
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
505
517
|
deprecated: Optional[bool] = None,
|
|
506
518
|
include_in_schema: bool = True,
|
|
507
519
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -518,6 +530,7 @@ class Body(FieldInfo):
|
|
|
518
530
|
)
|
|
519
531
|
self.example = example
|
|
520
532
|
self.include_in_schema = include_in_schema
|
|
533
|
+
self.openapi_examples = openapi_examples
|
|
521
534
|
kwargs = dict(
|
|
522
535
|
default=default,
|
|
523
536
|
default_factory=default_factory,
|
|
@@ -613,6 +626,7 @@ class Form(Body):
|
|
|
613
626
|
"although still supported. Use examples instead."
|
|
614
627
|
),
|
|
615
628
|
] = _Unset,
|
|
629
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
616
630
|
deprecated: Optional[bool] = None,
|
|
617
631
|
include_in_schema: bool = True,
|
|
618
632
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -647,6 +661,7 @@ class Form(Body):
|
|
|
647
661
|
deprecated=deprecated,
|
|
648
662
|
example=example,
|
|
649
663
|
examples=examples,
|
|
664
|
+
openapi_examples=openapi_examples,
|
|
650
665
|
include_in_schema=include_in_schema,
|
|
651
666
|
json_schema_extra=json_schema_extra,
|
|
652
667
|
**extra,
|
|
@@ -696,6 +711,7 @@ class File(Form):
|
|
|
696
711
|
"although still supported. Use examples instead."
|
|
697
712
|
),
|
|
698
713
|
] = _Unset,
|
|
714
|
+
openapi_examples: Optional[Dict[str, Example]] = None,
|
|
699
715
|
deprecated: Optional[bool] = None,
|
|
700
716
|
include_in_schema: bool = True,
|
|
701
717
|
json_schema_extra: Union[Dict[str, Any], None] = None,
|
|
@@ -729,6 +745,7 @@ class File(Form):
|
|
|
729
745
|
deprecated=deprecated,
|
|
730
746
|
example=example,
|
|
731
747
|
examples=examples,
|
|
748
|
+
openapi_examples=openapi_examples,
|
|
732
749
|
include_in_schema=include_in_schema,
|
|
733
750
|
json_schema_extra=json_schema_extra,
|
|
734
751
|
**extra,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fastapi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.103.0
|
|
4
4
|
Summary: FastAPI framework, high performance, easy to learn, fast to code, ready for production
|
|
5
5
|
Project-URL: Homepage, https://github.com/tiangolo/fastapi
|
|
6
6
|
Project-URL: Documentation, https://fastapi.tiangolo.com/
|
|
@@ -104,6 +104,7 @@ The key features are:
|
|
|
104
104
|
<a href="https://cryptapi.io/" target="_blank" title="CryptAPI: Your easy to use, secure and privacy oriented payment gateway."><img src="https://fastapi.tiangolo.com/img/sponsors/cryptapi.svg"></a>
|
|
105
105
|
<a href="https://platform.sh/try-it-now/?utm_source=fastapi-signup&utm_medium=banner&utm_campaign=FastAPI-signup-June-2023" target="_blank" title="Build, run and scale your apps on a modern, reliable, and secure PaaS."><img src="https://fastapi.tiangolo.com/img/sponsors/platform-sh.png"></a>
|
|
106
106
|
<a href="https://www.buildwithfern.com/?utm_source=tiangolo&utm_medium=website&utm_campaign=main-badge" target="_blank" title="Fern | SDKs and API docs"><img src="https://fastapi.tiangolo.com/img/sponsors/fern.svg"></a>
|
|
107
|
+
<a href="https://www.porter.run" target="_blank" title="Deploy FastAPI on AWS with a few clicks"><img src="https://fastapi.tiangolo.com/img/sponsors/porter.png"></a>
|
|
107
108
|
<a href="https://www.deta.sh/?ref=fastapi" target="_blank" title="The launchpad for all your (team's) ideas"><img src="https://fastapi.tiangolo.com/img/sponsors/deta.svg"></a>
|
|
108
109
|
<a href="https://training.talkpython.fm/fastapi-courses" target="_blank" title="FastAPI video courses on demand from people you trust"><img src="https://fastapi.tiangolo.com/img/sponsors/talkpython.png"></a>
|
|
109
110
|
<a href="https://testdriven.io/courses/tdd-fastapi/" target="_blank" title="Learn to build high-quality web apps with best practices"><img src="https://fastapi.tiangolo.com/img/sponsors/testdriven.svg"></a>
|
|
@@ -111,6 +112,7 @@ The key features are:
|
|
|
111
112
|
<a href="https://careers.powens.com/" target="_blank" title="Powens is hiring!"><img src="https://fastapi.tiangolo.com/img/sponsors/powens.png"></a>
|
|
112
113
|
<a href="https://www.svix.com/" target="_blank" title="Svix - Webhooks as a service"><img src="https://fastapi.tiangolo.com/img/sponsors/svix.svg"></a>
|
|
113
114
|
<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>
|
|
115
|
+
<a href="https://speakeasyapi.dev?utm_source=fastapi+repo&utm_medium=github+sponsorship" target="_blank" title="SDKs for your API | Speakeasy"><img src="https://fastapi.tiangolo.com/img/sponsors/speakeasy.png"></a>
|
|
114
116
|
|
|
115
117
|
<!-- /sponsors -->
|
|
116
118
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
fastapi/__init__.py,sha256=
|
|
2
|
-
fastapi/_compat.py,sha256=
|
|
3
|
-
fastapi/applications.py,sha256=
|
|
1
|
+
fastapi/__init__.py,sha256=h0fWTZ2oDwWSIdR2lMOSBUBP2yKgc0EastyxddBu5Aw,1081
|
|
2
|
+
fastapi/_compat.py,sha256=rIhdPUb9XYHxkeCJH1EdVDB3d93Ne2cGhlHb65p9edY,22568
|
|
3
|
+
fastapi/applications.py,sha256=hCZttoVGHOZ2jRMwJ_ntXFzjuAXVreFGv5mPhy6MFaA,40230
|
|
4
4
|
fastapi/background.py,sha256=HtN5_pJJrOdalSbuGSMKJAPNWUU5h7rY_BXXubu7-IQ,76
|
|
5
5
|
fastapi/concurrency.py,sha256=NAK9SMlTCOALLjTAR6KzWUDEkVj7_EyNRz0-lDVW_W8,1467
|
|
6
6
|
fastapi/datastructures.py,sha256=iWyfPvU6gZuFPHUC1RzRQP6VnLqYWnD75no5uLIxB48,2793
|
|
@@ -8,8 +8,8 @@ fastapi/encoders.py,sha256=4EZEx0D8NjMLr793L9gBSc867V_WwsA22LWxroPy13Y,8044
|
|
|
8
8
|
fastapi/exception_handlers.py,sha256=MBrIOA-ugjJDivIi4rSsUJBdTsjuzN76q4yh0q1COKw,1332
|
|
9
9
|
fastapi/exceptions.py,sha256=svNjh4_VJogfG3dzsn21TtwOxy6l-bXIoYxoUjAxteI,1585
|
|
10
10
|
fastapi/logger.py,sha256=I9NNi3ov8AcqbsbC9wl1X-hdItKgYt2XTrx1f99Zpl4,54
|
|
11
|
-
fastapi/param_functions.py,sha256=
|
|
12
|
-
fastapi/params.py,sha256=
|
|
11
|
+
fastapi/param_functions.py,sha256=_bqVX6LLUFjFOuua7UBIP3dXRpcdyrsnFEwPqBokwV8,19168
|
|
12
|
+
fastapi/params.py,sha256=LzjihAvODd3w7-GddraUyVtH1xfwR9smIoQn-Z_g4mg,27807
|
|
13
13
|
fastapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
fastapi/requests.py,sha256=zayepKFcienBllv3snmWI20Gk0oHNVLU4DDhqXBb4LU,142
|
|
15
15
|
fastapi/responses.py,sha256=on95e4CfSRyNz7MEjqFuzsP-eW8kHWTxEl_Z-Vzb7lA,1242
|
|
@@ -33,8 +33,8 @@ fastapi/middleware/wsgi.py,sha256=Z3Ue-7wni4lUZMvH3G9ek__acgYdJstbnpZX_HQAboY,79
|
|
|
33
33
|
fastapi/openapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
fastapi/openapi/constants.py,sha256=adGzmis1L1HJRTE3kJ5fmHS_Noq6tIY6pWv_SFzoFDU,153
|
|
35
35
|
fastapi/openapi/docs.py,sha256=HbP76-u4A45BrL4WjLMhA3MBVI9xMx7XiMyDRS_ZO0E,6532
|
|
36
|
-
fastapi/openapi/models.py,sha256=
|
|
37
|
-
fastapi/openapi/utils.py,sha256=
|
|
36
|
+
fastapi/openapi/models.py,sha256=alc7SWZeDXSWWC-HMdsVGy53BuS2RBbGpK_IiSgaREA,17759
|
|
37
|
+
fastapi/openapi/utils.py,sha256=PUuz_ISarHVPBRyIgfyHz8uwH0eEsDY3rJUfW__I9GI,22303
|
|
38
38
|
fastapi/security/__init__.py,sha256=bO8pNmxqVRXUjfl2mOKiVZLn0FpBQ61VUYVjmppnbJw,881
|
|
39
39
|
fastapi/security/api_key.py,sha256=92kxZjj9OuIvQCUpLszP9qlILRgx6hCh1x-bZdhmQDU,2939
|
|
40
40
|
fastapi/security/base.py,sha256=dl4pvbC-RxjfbWgPtCWd8MVU-7CB2SZ22rJDXVCXO6c,141
|
|
@@ -42,7 +42,7 @@ fastapi/security/http.py,sha256=VbTm1k6t6EjJAnCnYVquSOmSK7fATdKRgq0-TgC7FnQ,5964
|
|
|
42
42
|
fastapi/security/oauth2.py,sha256=fXQdWuTtUKSZ9Lyrj9fDuQoXAmXTd9AVFDrrwStJKX0,8579
|
|
43
43
|
fastapi/security/open_id_connect_url.py,sha256=GKK84g6OZbOFCEZJyd27pGjpaClGxeZrYOemUzyhfbU,1141
|
|
44
44
|
fastapi/security/utils.py,sha256=bd8T0YM7UQD5ATKucr1bNtAvz_Y3__dVNAv5UebiPvc,293
|
|
45
|
-
fastapi-0.
|
|
46
|
-
fastapi-0.
|
|
47
|
-
fastapi-0.
|
|
48
|
-
fastapi-0.
|
|
45
|
+
fastapi-0.103.0.dist-info/METADATA,sha256=5IzAieglNHsMCxopNzH1c8vkT2v_UnRyLDJ2zYu9ZLg,24070
|
|
46
|
+
fastapi-0.103.0.dist-info/WHEEL,sha256=KGYbc1zXlYddvwxnNty23BeaKzh7YuoSIvIMO4jEhvw,87
|
|
47
|
+
fastapi-0.103.0.dist-info/licenses/LICENSE,sha256=Tsif_IFIW5f-xYSy1KlhAy7v_oNEU4lP2cEnSQbMdE4,1086
|
|
48
|
+
fastapi-0.103.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|