diff --git a/fastapi/param_functions.py b/fastapi/param_functions.py index 50e54e4417..1e7237fac9 100644 --- a/fastapi/param_functions.py +++ b/fastapi/param_functions.py @@ -240,7 +240,7 @@ def Path( # noqa: N802 "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: Annotated[ dict[str, Example] | None, Doc( @@ -599,7 +599,7 @@ def Query( # noqa: N802 "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: Annotated[ dict[str, Example] | None, Doc( @@ -921,7 +921,7 @@ def Header( # noqa: N802 "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: Annotated[ dict[str, Example] | None, Doc( @@ -1227,7 +1227,7 @@ def Cookie( # noqa: N802 "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: Annotated[ dict[str, Example] | None, Doc( @@ -1555,7 +1555,7 @@ def Body( # noqa: N802 "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: Annotated[ dict[str, Example] | None, Doc( @@ -1871,7 +1871,7 @@ def Form( # noqa: N802 "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: Annotated[ dict[str, Example] | None, Doc( @@ -2186,7 +2186,7 @@ def File( # noqa: N802 "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: Annotated[ dict[str, Example] | None, Doc( diff --git a/fastapi/params.py b/fastapi/params.py index f695efc84a..ec4dc15115 100644 --- a/fastapi/params.py +++ b/fastapi/params.py @@ -65,7 +65,7 @@ class Param(FieldInfo): # type: ignore[misc] "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: dict[str, Example] | None = None, deprecated: deprecated | str | bool | None = None, include_in_schema: bool = True, @@ -176,7 +176,7 @@ class Path(Param): # type: ignore[misc] # ty: ignore[unused-ignore-comment] "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: dict[str, Example] | None = None, deprecated: deprecated | str | bool | None = None, include_in_schema: bool = True, @@ -260,7 +260,7 @@ class Query(Param): # type: ignore[misc] # ty: ignore[unused-ignore-comment] "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: dict[str, Example] | None = None, deprecated: deprecated | str | bool | None = None, include_in_schema: bool = True, @@ -343,7 +343,7 @@ class Header(Param): # type: ignore[misc] # ty: ignore[unused-ignore-comment] "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: dict[str, Example] | None = None, deprecated: deprecated | str | bool | None = None, include_in_schema: bool = True, @@ -426,7 +426,7 @@ class Cookie(Param): # type: ignore[misc] # ty: ignore[unused-ignore-comment] "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: dict[str, Example] | None = None, deprecated: deprecated | str | bool | None = None, include_in_schema: bool = True, @@ -508,7 +508,7 @@ class Body(FieldInfo): # type: ignore[misc] "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: dict[str, Example] | None = None, deprecated: deprecated | str | bool | None = None, include_in_schema: bool = True, @@ -619,7 +619,7 @@ class Form(Body): # type: ignore[misc] # ty: ignore[unused-ignore-comment] "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: dict[str, Example] | None = None, deprecated: deprecated | str | bool | None = None, include_in_schema: bool = True, @@ -701,7 +701,7 @@ class File(Form): # type: ignore[misc] # ty: ignore[unused-ignore-comment] "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "although still supported. Use examples instead." ), - ] = _Unset, # ty: ignore[invalid-parameter-default] + ] = _Unset, openapi_examples: dict[str, Example] | None = None, deprecated: deprecated | str | bool | None = None, include_in_schema: bool = True,