Browse Source

revert the ones where Any is one of the input types

pull/15091/head
svlandeg 4 months ago
parent
commit
c2f5335e44
  1. 14
      fastapi/param_functions.py
  2. 16
      fastapi/params.py

14
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, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: Annotated[ openapi_examples: Annotated[
dict[str, Example] | None, dict[str, Example] | None,
Doc( Doc(
@ -599,7 +599,7 @@ def Query( # noqa: N802
"Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: Annotated[ openapi_examples: Annotated[
dict[str, Example] | None, dict[str, Example] | None,
Doc( Doc(
@ -921,7 +921,7 @@ def Header( # noqa: N802
"Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: Annotated[ openapi_examples: Annotated[
dict[str, Example] | None, dict[str, Example] | None,
Doc( Doc(
@ -1227,7 +1227,7 @@ def Cookie( # noqa: N802
"Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: Annotated[ openapi_examples: Annotated[
dict[str, Example] | None, dict[str, Example] | None,
Doc( Doc(
@ -1555,7 +1555,7 @@ def Body( # noqa: N802
"Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: Annotated[ openapi_examples: Annotated[
dict[str, Example] | None, dict[str, Example] | None,
Doc( Doc(
@ -1871,7 +1871,7 @@ def Form( # noqa: N802
"Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: Annotated[ openapi_examples: Annotated[
dict[str, Example] | None, dict[str, Example] | None,
Doc( Doc(
@ -2186,7 +2186,7 @@ def File( # noqa: N802
"Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: Annotated[ openapi_examples: Annotated[
dict[str, Example] | None, dict[str, Example] | None,
Doc( Doc(

16
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, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: dict[str, Example] | None = None, openapi_examples: dict[str, Example] | None = None,
deprecated: deprecated | str | bool | None = None, deprecated: deprecated | str | bool | None = None,
include_in_schema: bool = True, 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, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: dict[str, Example] | None = None, openapi_examples: dict[str, Example] | None = None,
deprecated: deprecated | str | bool | None = None, deprecated: deprecated | str | bool | None = None,
include_in_schema: bool = True, 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, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: dict[str, Example] | None = None, openapi_examples: dict[str, Example] | None = None,
deprecated: deprecated | str | bool | None = None, deprecated: deprecated | str | bool | None = None,
include_in_schema: bool = True, 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, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: dict[str, Example] | None = None, openapi_examples: dict[str, Example] | None = None,
deprecated: deprecated | str | bool | None = None, deprecated: deprecated | str | bool | None = None,
include_in_schema: bool = True, 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, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: dict[str, Example] | None = None, openapi_examples: dict[str, Example] | None = None,
deprecated: deprecated | str | bool | None = None, deprecated: deprecated | str | bool | None = None,
include_in_schema: bool = True, 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, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: dict[str, Example] | None = None, openapi_examples: dict[str, Example] | None = None,
deprecated: deprecated | str | bool | None = None, deprecated: deprecated | str | bool | None = None,
include_in_schema: bool = True, 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, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: dict[str, Example] | None = None, openapi_examples: dict[str, Example] | None = None,
deprecated: deprecated | str | bool | None = None, deprecated: deprecated | str | bool | None = None,
include_in_schema: bool = True, 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, " "Deprecated in OpenAPI 3.1.0 that now uses JSON Schema 2020-12, "
"although still supported. Use examples instead." "although still supported. Use examples instead."
), ),
] = _Unset, # ty: ignore[invalid-parameter-default] ] = _Unset,
openapi_examples: dict[str, Example] | None = None, openapi_examples: dict[str, Example] | None = None,
deprecated: deprecated | str | bool | None = None, deprecated: deprecated | str | bool | None = None,
include_in_schema: bool = True, include_in_schema: bool = True,

Loading…
Cancel
Save