]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
✨ Add support for Pydantic's 2.7 new deprecated Field parameter, remove URL from...
authorSebastián Ramírez <tiangolo@gmail.com>
Thu, 18 Apr 2024 19:40:57 +0000 (14:40 -0500)
committerGitHub <noreply@github.com>
Thu, 18 Apr 2024 19:40:57 +0000 (14:40 -0500)
74 files changed:
.github/workflows/test.yml
docs_src/path_operation_advanced_configuration/tutorial007.py
fastapi/_compat.py
fastapi/openapi/utils.py
fastapi/param_functions.py
fastapi/params.py
fastapi/utils.py
tests/test_annotated.py
tests/test_dependency_duplicates.py
tests/test_dependency_overrides.py
tests/test_filter_pydantic_sub_model_pv2.py
tests/test_multi_body_errors.py
tests/test_multi_query_errors.py
tests/test_path.py
tests/test_query.py
tests/test_regex_deprecated_body.py
tests/test_regex_deprecated_params.py
tests/test_security_oauth2.py
tests/test_security_oauth2_optional.py
tests/test_security_oauth2_optional_description.py
tests/test_tutorial/test_bigger_applications/test_main.py
tests/test_tutorial/test_bigger_applications/test_main_an.py
tests/test_tutorial/test_bigger_applications/test_main_an_py39.py
tests/test_tutorial/test_body/test_tutorial001.py
tests/test_tutorial/test_body/test_tutorial001_py310.py
tests/test_tutorial/test_body_fields/test_tutorial001.py
tests/test_tutorial/test_body_fields/test_tutorial001_an.py
tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py
tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py
tests/test_tutorial/test_body_fields/test_tutorial001_py310.py
tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py
tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py310.py
tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py
tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py
tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py
tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py
tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py
tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py
tests/test_tutorial/test_body_nested_models/test_tutorial009.py
tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py
tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
tests/test_tutorial/test_dataclasses/test_tutorial001.py
tests/test_tutorial/test_dependencies/test_tutorial006.py
tests/test_tutorial/test_dependencies/test_tutorial006_an.py
tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py
tests/test_tutorial/test_dependencies/test_tutorial012.py
tests/test_tutorial/test_dependencies/test_tutorial012_an.py
tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py
tests/test_tutorial/test_handling_errors/test_tutorial005.py
tests/test_tutorial/test_handling_errors/test_tutorial006.py
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
tests/test_tutorial/test_query_params/test_tutorial005.py
tests/test_tutorial/test_query_params/test_tutorial006.py
tests/test_tutorial/test_query_params/test_tutorial006_py310.py
tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py
tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py
tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py
tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py
tests/test_tutorial/test_query_params_str_validations/test_tutorial010_py310.py
tests/test_tutorial/test_request_files/test_tutorial001.py
tests/test_tutorial/test_request_files/test_tutorial001_an.py
tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py
tests/test_tutorial/test_request_files/test_tutorial002.py
tests/test_tutorial/test_request_files/test_tutorial002_an.py
tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py
tests/test_tutorial/test_request_files/test_tutorial002_py39.py
tests/test_tutorial/test_request_forms/test_tutorial001.py
tests/test_tutorial/test_request_forms/test_tutorial001_an.py
tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py
tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py

index 125265e5382c9c0417965e636b01fe109dd2eecc..fe1e419d68945a2279b5347e1b363fa068a5e423 100644 (file)
@@ -32,7 +32,7 @@ jobs:
         id: cache
         with:
           path: ${{ env.pythonLocation }}
-          key: ${{ runner.os }}-python-${{ env.pythonLocation }}-pydantic-v2-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v07
+          key: ${{ runner.os }}-python-${{ env.pythonLocation }}-pydantic-v2-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v08
       - name: Install Dependencies
         if: steps.cache.outputs.cache-hit != 'true'
         run: pip install -r requirements-tests.txt
@@ -70,7 +70,7 @@ jobs:
         id: cache
         with:
           path: ${{ env.pythonLocation }}
-          key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ matrix.pydantic-version }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v07
+          key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ matrix.pydantic-version }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v08
       - name: Install Dependencies
         if: steps.cache.outputs.cache-hit != 'true'
         run: pip install -r requirements-tests.txt
index 972ddbd2cc918757e41c1417480d2d4a4039390b..54e2e9399e46263b6389e245fbd22bcba2b88703 100644 (file)
@@ -30,5 +30,5 @@ async def create_item(request: Request):
     try:
         item = Item.model_validate(data)
     except ValidationError as e:
-        raise HTTPException(status_code=422, detail=e.errors())
+        raise HTTPException(status_code=422, detail=e.errors(include_url=False))
     return item
index 35d4a8723113935a37a7d5267b8668662138fe10..06b847b4f3818b5a1ae7a183209877bffaa5c1b5 100644 (file)
@@ -20,10 +20,12 @@ from typing import (
 from fastapi.exceptions import RequestErrorModel
 from fastapi.types import IncEx, ModelNameMap, UnionType
 from pydantic import BaseModel, create_model
-from pydantic.version import VERSION as PYDANTIC_VERSION
+from pydantic.version import VERSION as P_VERSION
 from starlette.datastructures import UploadFile
 from typing_extensions import Annotated, Literal, get_args, get_origin
 
+# Reassign variable to make it reexported for mypy
+PYDANTIC_VERSION = P_VERSION
 PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")
 
 
@@ -127,7 +129,7 @@ if PYDANTIC_V2:
                 )
             except ValidationError as exc:
                 return None, _regenerate_error_with_loc(
-                    errors=exc.errors(), loc_prefix=loc
+                    errors=exc.errors(include_url=False), loc_prefix=loc
                 )
 
         def serialize(
@@ -266,7 +268,7 @@ if PYDANTIC_V2:
     def get_missing_field_error(loc: Tuple[str, ...]) -> Dict[str, Any]:
         error = ValidationError.from_exception_data(
             "Field required", [{"type": "missing", "loc": loc, "input": {}}]
-        ).errors()[0]
+        ).errors(include_url=False)[0]
         error["input"] = None
         return error  # type: ignore[return-value]
 
index 5bfb5acef7fc47b220bfb159345b5c02cd8e8398..79ad9f83f221f5927ee54f3adc831902fb9a46b2 100644 (file)
@@ -123,7 +123,7 @@ def get_openapi_operation_parameters(
         elif field_info.example != Undefined:
             parameter["example"] = jsonable_encoder(field_info.example)
         if field_info.deprecated:
-            parameter["deprecated"] = field_info.deprecated
+            parameter["deprecated"] = True
         parameters.append(parameter)
     return parameters
 
index 6722a7d66c00b3e1b0503f05b035814580bef0be..3b25d774adabce5d091c247438f5ff8fa6799e12 100644 (file)
@@ -240,7 +240,7 @@ def Path(  # noqa: N802
         ),
     ] = None,
     deprecated: Annotated[
-        Optional[bool],
+        Union[deprecated, str, bool, None],
         Doc(
             """
             Mark this parameter field as deprecated.
@@ -565,7 +565,7 @@ def Query(  # noqa: N802
         ),
     ] = None,
     deprecated: Annotated[
-        Optional[bool],
+        Union[deprecated, str, bool, None],
         Doc(
             """
             Mark this parameter field as deprecated.
@@ -880,7 +880,7 @@ def Header(  # noqa: N802
         ),
     ] = None,
     deprecated: Annotated[
-        Optional[bool],
+        Union[deprecated, str, bool, None],
         Doc(
             """
             Mark this parameter field as deprecated.
@@ -1185,7 +1185,7 @@ def Cookie(  # noqa: N802
         ),
     ] = None,
     deprecated: Annotated[
-        Optional[bool],
+        Union[deprecated, str, bool, None],
         Doc(
             """
             Mark this parameter field as deprecated.
@@ -1512,7 +1512,7 @@ def Body(  # noqa: N802
         ),
     ] = None,
     deprecated: Annotated[
-        Optional[bool],
+        Union[deprecated, str, bool, None],
         Doc(
             """
             Mark this parameter field as deprecated.
@@ -1827,7 +1827,7 @@ def Form(  # noqa: N802
         ),
     ] = None,
     deprecated: Annotated[
-        Optional[bool],
+        Union[deprecated, str, bool, None],
         Doc(
             """
             Mark this parameter field as deprecated.
@@ -2141,7 +2141,7 @@ def File(  # noqa: N802
         ),
     ] = None,
     deprecated: Annotated[
-        Optional[bool],
+        Union[deprecated, str, bool, None],
         Doc(
             """
             Mark this parameter field as deprecated.
index b40944dba6f56498205bfe899d8054e3fcd2e6e3..860146531ab23f777fa314ce9640a758d2d210d7 100644 (file)
@@ -6,7 +6,7 @@ from fastapi.openapi.models import Example
 from pydantic.fields import FieldInfo
 from typing_extensions import Annotated, deprecated
 
-from ._compat import PYDANTIC_V2, Undefined
+from ._compat import PYDANTIC_V2, PYDANTIC_VERSION, Undefined
 
 _Unset: Any = Undefined
 
@@ -63,12 +63,11 @@ class Param(FieldInfo):
             ),
         ] = _Unset,
         openapi_examples: Optional[Dict[str, Example]] = None,
-        deprecated: Optional[bool] = None,
+        deprecated: Union[deprecated, str, bool, None] = None,
         include_in_schema: bool = True,
         json_schema_extra: Union[Dict[str, Any], None] = None,
         **extra: Any,
     ):
-        self.deprecated = deprecated
         if example is not _Unset:
             warnings.warn(
                 "`example` has been deprecated, please use `examples` instead",
@@ -106,6 +105,10 @@ class Param(FieldInfo):
                 stacklevel=4,
             )
         current_json_schema_extra = json_schema_extra or extra
+        if PYDANTIC_VERSION < "2.7.0":
+            self.deprecated = deprecated
+        else:
+            kwargs["deprecated"] = deprecated
         if PYDANTIC_V2:
             kwargs.update(
                 {
@@ -174,7 +177,7 @@ class Path(Param):
             ),
         ] = _Unset,
         openapi_examples: Optional[Dict[str, Example]] = None,
-        deprecated: Optional[bool] = None,
+        deprecated: Union[deprecated, str, bool, None] = None,
         include_in_schema: bool = True,
         json_schema_extra: Union[Dict[str, Any], None] = None,
         **extra: Any,
@@ -260,7 +263,7 @@ class Query(Param):
             ),
         ] = _Unset,
         openapi_examples: Optional[Dict[str, Example]] = None,
-        deprecated: Optional[bool] = None,
+        deprecated: Union[deprecated, str, bool, None] = None,
         include_in_schema: bool = True,
         json_schema_extra: Union[Dict[str, Any], None] = None,
         **extra: Any,
@@ -345,7 +348,7 @@ class Header(Param):
             ),
         ] = _Unset,
         openapi_examples: Optional[Dict[str, Example]] = None,
-        deprecated: Optional[bool] = None,
+        deprecated: Union[deprecated, str, bool, None] = None,
         include_in_schema: bool = True,
         json_schema_extra: Union[Dict[str, Any], None] = None,
         **extra: Any,
@@ -430,7 +433,7 @@ class Cookie(Param):
             ),
         ] = _Unset,
         openapi_examples: Optional[Dict[str, Example]] = None,
-        deprecated: Optional[bool] = None,
+        deprecated: Union[deprecated, str, bool, None] = None,
         include_in_schema: bool = True,
         json_schema_extra: Union[Dict[str, Any], None] = None,
         **extra: Any,
@@ -514,14 +517,13 @@ class Body(FieldInfo):
             ),
         ] = _Unset,
         openapi_examples: Optional[Dict[str, Example]] = None,
-        deprecated: Optional[bool] = None,
+        deprecated: Union[deprecated, str, bool, None] = None,
         include_in_schema: bool = True,
         json_schema_extra: Union[Dict[str, Any], None] = None,
         **extra: Any,
     ):
         self.embed = embed
         self.media_type = media_type
-        self.deprecated = deprecated
         if example is not _Unset:
             warnings.warn(
                 "`example` has been deprecated, please use `examples` instead",
@@ -559,6 +561,10 @@ class Body(FieldInfo):
                 stacklevel=4,
             )
         current_json_schema_extra = json_schema_extra or extra
+        if PYDANTIC_VERSION < "2.7.0":
+            self.deprecated = deprecated
+        else:
+            kwargs["deprecated"] = deprecated
         if PYDANTIC_V2:
             kwargs.update(
                 {
@@ -627,7 +633,7 @@ class Form(Body):
             ),
         ] = _Unset,
         openapi_examples: Optional[Dict[str, Example]] = None,
-        deprecated: Optional[bool] = None,
+        deprecated: Union[deprecated, str, bool, None] = None,
         include_in_schema: bool = True,
         json_schema_extra: Union[Dict[str, Any], None] = None,
         **extra: Any,
@@ -712,7 +718,7 @@ class File(Form):
             ),
         ] = _Unset,
         openapi_examples: Optional[Dict[str, Example]] = None,
-        deprecated: Optional[bool] = None,
+        deprecated: Union[deprecated, str, bool, None] = None,
         include_in_schema: bool = True,
         json_schema_extra: Union[Dict[str, Any], None] = None,
         **extra: Any,
index 53b2fa0c36ba65afb730666f1b811dad3533c407..dfda4e678a544e233ad3ffb10bdfd98ff032f0f2 100644 (file)
@@ -221,9 +221,3 @@ def get_value_or_default(
         if not isinstance(item, DefaultPlaceholder):
             return item
     return first_item
-
-
-def match_pydantic_error_url(error_type: str) -> Any:
-    from dirty_equals import IsStr
-
-    return IsStr(regex=rf"^https://errors\.pydantic\.dev/.*/v/{error_type}")
index 2222be9783c086d9cf1cfbcce37f16a7650d33c3..473d33e52c36cba60bd8705b5196f49db59e494d 100644 (file)
@@ -2,7 +2,6 @@ import pytest
 from dirty_equals import IsDict
 from fastapi import APIRouter, FastAPI, Query
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 from typing_extensions import Annotated
 
 app = FastAPI()
@@ -38,7 +37,6 @@ foo_is_missing = {
                 "msg": "Field required",
                 "type": "missing",
                 "input": None,
-                "url": match_pydantic_error_url("missing"),
             }
         )
         # TODO: remove when deprecating Pydantic v1
@@ -60,7 +58,6 @@ foo_is_short = {
                 "msg": "String should have at least 1 character",
                 "type": "string_too_short",
                 "input": "",
-                "url": match_pydantic_error_url("string_too_short"),
             }
         )
         # TODO: remove when deprecating Pydantic v1
index 0882cc41d7abff336830f8929e787a20e2f7159a..8e8d07c2d61ab18355523d18625937156204d4dc 100644 (file)
@@ -3,7 +3,6 @@ from typing import List
 from dirty_equals import IsDict
 from fastapi import Depends, FastAPI
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 from pydantic import BaseModel
 
 app = FastAPI()
@@ -57,7 +56,6 @@ def test_no_duplicates_invalid():
                     "loc": ["body", "item2"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index 21cff998d18c42381bb9e101422ba19a72a3908e..154937fa0b9b6c0b1832c44fb9a742ab727452dc 100644 (file)
@@ -4,7 +4,6 @@ import pytest
 from dirty_equals import IsDict
 from fastapi import APIRouter, Depends, FastAPI
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 app = FastAPI()
 
@@ -63,7 +62,6 @@ def test_main_depends():
                     "loc": ["query", "q"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -110,7 +108,6 @@ def test_decorator_depends():
                     "loc": ["query", "q"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -151,7 +148,6 @@ def test_router_depends():
                     "loc": ["query", "q"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -198,7 +194,6 @@ def test_router_decorator_depends():
                     "loc": ["query", "q"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -285,7 +280,6 @@ def test_override_with_sub_main_depends():
                     "loc": ["query", "k"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -316,7 +310,6 @@ def test_override_with_sub__main_depends_q_foo():
                     "loc": ["query", "k"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -355,7 +348,6 @@ def test_override_with_sub_decorator_depends():
                     "loc": ["query", "k"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -386,7 +378,6 @@ def test_override_with_sub_decorator_depends_q_foo():
                     "loc": ["query", "k"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -425,7 +416,6 @@ def test_override_with_sub_router_depends():
                     "loc": ["query", "k"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -456,7 +446,6 @@ def test_override_with_sub_router_depends_q_foo():
                     "loc": ["query", "k"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -495,7 +484,6 @@ def test_override_with_sub_router_decorator_depends():
                     "loc": ["query", "k"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -526,7 +514,6 @@ def test_override_with_sub_router_decorator_depends_q_foo():
                     "loc": ["query", "k"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index 9097d2ce52e01991922c08dc9e2b37e46a578c16..2e2c26ddcbc5aab4bd4e04ecec7e35d2e518fa3a 100644 (file)
@@ -5,7 +5,6 @@ from dirty_equals import HasRepr, IsDict, IsOneOf
 from fastapi import Depends, FastAPI
 from fastapi.exceptions import ResponseValidationError
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from .utils import needs_pydanticv2
 
@@ -67,7 +66,6 @@ def test_validator_is_cloned(client: TestClient):
                 "msg": "Value error, name must end in A",
                 "input": "modelX",
                 "ctx": {"error": HasRepr("ValueError('name must end in A')")},
-                "url": match_pydantic_error_url("value_error"),
             }
         )
         | IsDict(
index a51ca7253f8257c7b522013b8995766002d3b331..0102f0f1a08452cd1c96c177f4c70a74524a710c 100644 (file)
@@ -4,7 +4,6 @@ from typing import List
 from dirty_equals import IsDict, IsOneOf
 from fastapi import FastAPI
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 from pydantic import BaseModel, condecimal
 
 app = FastAPI()
@@ -52,7 +51,6 @@ def test_jsonable_encoder_requiring_error():
                     "msg": "Input should be greater than 0",
                     "input": -1.0,
                     "ctx": {"gt": 0},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
@@ -82,28 +80,24 @@ def test_put_incorrect_body_multiple():
                     "loc": ["body", 0, "name"],
                     "msg": "Field required",
                     "input": {"age": "five"},
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "decimal_parsing",
                     "loc": ["body", 0, "age"],
                     "msg": "Input should be a valid decimal",
                     "input": "five",
-                    "url": match_pydantic_error_url("decimal_parsing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", 1, "name"],
                     "msg": "Field required",
                     "input": {"age": "six"},
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "decimal_parsing",
                     "loc": ["body", 1, "age"],
                     "msg": "Input should be a valid decimal",
                     "input": "six",
-                    "url": match_pydantic_error_url("decimal_parsing"),
                 },
             ]
         }
index 470a3580834687b4cc8906746bccd83358231fcb..8162d986c577e887f143ae6cc3c009d3f0f56792 100644 (file)
@@ -3,7 +3,6 @@ from typing import List
 from dirty_equals import IsDict
 from fastapi import FastAPI, Query
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 app = FastAPI()
 
@@ -33,14 +32,12 @@ def test_multi_query_incorrect():
                     "loc": ["query", "q", 0],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "five",
-                    "url": match_pydantic_error_url("int_parsing"),
                 },
                 {
                     "type": "int_parsing",
                     "loc": ["query", "q", 1],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "six",
-                    "url": match_pydantic_error_url("int_parsing"),
                 },
             ]
         }
index 848b245e2c4d4d13b7bfd72820bcfea1282e7373..09c1f13fb157369194f089d8ea8b9619d3ab483e 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from .main import app
 
@@ -54,7 +53,6 @@ def test_path_int_foobar():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foobar",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -83,7 +81,6 @@ def test_path_int_True():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "True",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -118,7 +115,6 @@ def test_path_int_42_5():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "42.5",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -147,7 +143,6 @@ def test_path_float_foobar():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid number, unable to parse string as a number",
                     "input": "foobar",
-                    "url": match_pydantic_error_url("float_parsing"),
                 }
             ]
         }
@@ -176,7 +171,6 @@ def test_path_float_True():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid number, unable to parse string as a number",
                     "input": "True",
-                    "url": match_pydantic_error_url("float_parsing"),
                 }
             ]
         }
@@ -217,7 +211,6 @@ def test_path_bool_foobar():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid boolean, unable to interpret input",
                     "input": "foobar",
-                    "url": match_pydantic_error_url("bool_parsing"),
                 }
             ]
         }
@@ -252,7 +245,6 @@ def test_path_bool_42():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid boolean, unable to interpret input",
                     "input": "42",
-                    "url": match_pydantic_error_url("bool_parsing"),
                 }
             ]
         }
@@ -281,7 +273,6 @@ def test_path_bool_42_5():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid boolean, unable to interpret input",
                     "input": "42.5",
-                    "url": match_pydantic_error_url("bool_parsing"),
                 }
             ]
         }
@@ -353,7 +344,6 @@ def test_path_param_minlength_fo():
                     "msg": "String should have at least 3 characters",
                     "input": "fo",
                     "ctx": {"min_length": 3},
-                    "url": match_pydantic_error_url("string_too_short"),
                 }
             ]
         }
@@ -390,7 +380,6 @@ def test_path_param_maxlength_foobar():
                     "msg": "String should have at most 3 characters",
                     "input": "foobar",
                     "ctx": {"max_length": 3},
-                    "url": match_pydantic_error_url("string_too_long"),
                 }
             ]
         }
@@ -427,7 +416,6 @@ def test_path_param_min_maxlength_foobar():
                     "msg": "String should have at most 3 characters",
                     "input": "foobar",
                     "ctx": {"max_length": 3},
-                    "url": match_pydantic_error_url("string_too_long"),
                 }
             ]
         }
@@ -458,7 +446,6 @@ def test_path_param_min_maxlength_f():
                     "msg": "String should have at least 2 characters",
                     "input": "f",
                     "ctx": {"min_length": 2},
-                    "url": match_pydantic_error_url("string_too_short"),
                 }
             ]
         }
@@ -494,7 +481,6 @@ def test_path_param_gt_2():
                     "msg": "Input should be greater than 3",
                     "input": "2",
                     "ctx": {"gt": 3.0},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
@@ -531,7 +517,6 @@ def test_path_param_gt0_0():
                     "msg": "Input should be greater than 0",
                     "input": "0",
                     "ctx": {"gt": 0.0},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
@@ -574,7 +559,6 @@ def test_path_param_ge_2():
                     "msg": "Input should be greater than or equal to 3",
                     "input": "2",
                     "ctx": {"ge": 3.0},
-                    "url": match_pydantic_error_url("greater_than_equal"),
                 }
             ]
         }
@@ -605,7 +589,6 @@ def test_path_param_lt_42():
                     "msg": "Input should be less than 3",
                     "input": "42",
                     "ctx": {"lt": 3.0},
-                    "url": match_pydantic_error_url("less_than"),
                 }
             ]
         }
@@ -648,7 +631,6 @@ def test_path_param_lt0_0():
                     "msg": "Input should be less than 0",
                     "input": "0",
                     "ctx": {"lt": 0.0},
-                    "url": match_pydantic_error_url("less_than"),
                 }
             ]
         }
@@ -679,7 +661,6 @@ def test_path_param_le_42():
                     "msg": "Input should be less than or equal to 3",
                     "input": "42",
                     "ctx": {"le": 3.0},
-                    "url": match_pydantic_error_url("less_than_equal"),
                 }
             ]
         }
@@ -728,7 +709,6 @@ def test_path_param_lt_gt_4():
                     "msg": "Input should be less than 3",
                     "input": "4",
                     "ctx": {"lt": 3.0},
-                    "url": match_pydantic_error_url("less_than"),
                 }
             ]
         }
@@ -759,7 +739,6 @@ def test_path_param_lt_gt_0():
                     "msg": "Input should be greater than 1",
                     "input": "0",
                     "ctx": {"gt": 1.0},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
@@ -807,7 +786,6 @@ def test_path_param_le_ge_4():
                     "msg": "Input should be less than or equal to 3",
                     "input": "4",
                     "ctx": {"le": 3.0},
-                    "url": match_pydantic_error_url("less_than_equal"),
                 }
             ]
         }
@@ -844,7 +822,6 @@ def test_path_param_lt_int_42():
                     "msg": "Input should be less than 3",
                     "input": "42",
                     "ctx": {"lt": 3},
-                    "url": match_pydantic_error_url("less_than"),
                 }
             ]
         }
@@ -874,7 +851,6 @@ def test_path_param_lt_int_2_7():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "2.7",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -910,7 +886,6 @@ def test_path_param_gt_int_2():
                     "msg": "Input should be greater than 3",
                     "input": "2",
                     "ctx": {"gt": 3},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
@@ -940,7 +915,6 @@ def test_path_param_gt_int_2_7():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "2.7",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -970,7 +944,6 @@ def test_path_param_le_int_42():
                     "msg": "Input should be less than or equal to 3",
                     "input": "42",
                     "ctx": {"le": 3},
-                    "url": match_pydantic_error_url("less_than_equal"),
                 }
             ]
         }
@@ -1012,7 +985,6 @@ def test_path_param_le_int_2_7():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "2.7",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -1054,7 +1026,6 @@ def test_path_param_ge_int_2():
                     "msg": "Input should be greater than or equal to 3",
                     "input": "2",
                     "ctx": {"ge": 3},
-                    "url": match_pydantic_error_url("greater_than_equal"),
                 }
             ]
         }
@@ -1084,7 +1055,6 @@ def test_path_param_ge_int_2_7():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "2.7",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -1120,7 +1090,6 @@ def test_path_param_lt_gt_int_4():
                     "msg": "Input should be less than 3",
                     "input": "4",
                     "ctx": {"lt": 3},
-                    "url": match_pydantic_error_url("less_than"),
                 }
             ]
         }
@@ -1151,7 +1120,6 @@ def test_path_param_lt_gt_int_0():
                     "msg": "Input should be greater than 1",
                     "input": "0",
                     "ctx": {"gt": 1},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
@@ -1181,7 +1149,6 @@ def test_path_param_lt_gt_int_2_7():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "2.7",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -1229,7 +1196,6 @@ def test_path_param_le_ge_int_4():
                     "msg": "Input should be less than or equal to 3",
                     "input": "4",
                     "ctx": {"le": 3},
-                    "url": match_pydantic_error_url("less_than_equal"),
                 }
             ]
         }
@@ -1259,7 +1225,6 @@ def test_path_param_le_ge_int_2_7():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "2.7",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index 5bb9995d6c5ad443109264b0ac9e0ffdc5159060..2ce4fcd0b16888fb2c48f661b0d7df8211050a3a 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from .main import app
 
@@ -18,7 +17,6 @@ def test_query():
                     "loc": ["query", "query"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -53,7 +51,6 @@ def test_query_not_declared_baz():
                     "loc": ["query", "query"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -100,7 +97,6 @@ def test_query_int():
                     "loc": ["query", "query"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -135,7 +131,6 @@ def test_query_int_query_42_5():
                     "loc": ["query", "query"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "42.5",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -164,7 +159,6 @@ def test_query_int_query_baz():
                     "loc": ["query", "query"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "baz",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -193,7 +187,6 @@ def test_query_int_not_declared_baz():
                     "loc": ["query", "query"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -234,7 +227,6 @@ def test_query_int_optional_query_foo():
                     "loc": ["query", "query"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -275,7 +267,6 @@ def test_query_int_default_query_foo():
                     "loc": ["query", "query"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
@@ -316,7 +307,6 @@ def test_query_param_required():
                     "loc": ["query", "query"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -351,7 +341,6 @@ def test_query_param_required_int():
                     "loc": ["query", "query"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -386,7 +375,6 @@ def test_query_param_required_int_query_foo():
                     "loc": ["query", "query"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index 7afddd9ae00b3bbfaced62ad970cd06e3405a016..74654ff3cedc7db2cba50464c9cd9f54a82cf666 100644 (file)
@@ -2,7 +2,6 @@ import pytest
 from dirty_equals import IsDict
 from fastapi import FastAPI, Form
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 from typing_extensions import Annotated
 
 from .utils import needs_py310
@@ -55,7 +54,6 @@ def test_query_nonregexquery():
                     "msg": "String should match pattern '^fixedquery$'",
                     "input": "nonregexquery",
                     "ctx": {"pattern": "^fixedquery$"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index 7190b543cb63ed80327dfdecb0eda99624b6d5b4..2ce64c6862a3e5b8cb7bb4a17f903c6ffa9a15eb 100644 (file)
@@ -2,7 +2,6 @@ import pytest
 from dirty_equals import IsDict
 from fastapi import FastAPI, Query
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 from typing_extensions import Annotated
 
 from .utils import needs_py310
@@ -55,7 +54,6 @@ def test_query_params_str_validations_item_query_nonregexquery():
                     "msg": "String should match pattern '^fixedquery$'",
                     "input": "nonregexquery",
                     "ctx": {"pattern": "^fixedquery$"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index e98f80ebfbe03849d89ae4e0c9fb35636e78e86b..7d914d03452f674b6fdb34591bf5e0a00ddc4574 100644 (file)
@@ -2,7 +2,6 @@ from dirty_equals import IsDict
 from fastapi import Depends, FastAPI, Security
 from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 from pydantic import BaseModel
 
 app = FastAPI()
@@ -71,21 +70,18 @@ def test_strict_login_no_data():
                     "loc": ["body", "grant_type"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -124,7 +120,6 @@ def test_strict_login_no_grant_type():
                     "loc": ["body", "grant_type"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -157,7 +152,6 @@ def test_strict_login_incorrect_grant_type():
                     "msg": "String should match pattern 'password'",
                     "input": "incorrect",
                     "ctx": {"pattern": "password"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index d06c01bba0c7479b11615e3d197b7a3d6ed1fe8f..0da3b911e8467359b6ea1b4942398e574d27677f 100644 (file)
@@ -4,7 +4,6 @@ from dirty_equals import IsDict
 from fastapi import Depends, FastAPI, Security
 from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 from pydantic import BaseModel
 
 app = FastAPI()
@@ -75,21 +74,18 @@ def test_strict_login_no_data():
                     "loc": ["body", "grant_type"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -128,7 +124,6 @@ def test_strict_login_no_grant_type():
                     "loc": ["body", "grant_type"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -161,7 +156,6 @@ def test_strict_login_incorrect_grant_type():
                     "msg": "String should match pattern 'password'",
                     "input": "incorrect",
                     "ctx": {"pattern": "password"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index 9287e4366e64364b8cb3d4ca089d7f3b637fa364..85a9f9b3910358773f5f16188f42fb9be3a31e9f 100644 (file)
@@ -4,7 +4,6 @@ from dirty_equals import IsDict
 from fastapi import Depends, FastAPI, Security
 from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 from pydantic import BaseModel
 
 app = FastAPI()
@@ -76,21 +75,18 @@ def test_strict_login_None():
                     "loc": ["body", "grant_type"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -129,7 +125,6 @@ def test_strict_login_no_grant_type():
                     "loc": ["body", "grant_type"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -162,7 +157,6 @@ def test_strict_login_incorrect_grant_type():
                     "msg": "String should match pattern 'password'",
                     "input": "incorrect",
                     "ctx": {"pattern": "password"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index 526e265a612a49aa7a12c918d0939e249dd5d1e6..35fdfa4a667ee7bc0ecfb07dedd00b7d4043512c 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_users_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -64,7 +62,6 @@ def test_users_foo_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -99,7 +96,6 @@ def test_users_me_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -145,7 +141,6 @@ def test_items_with_no_token_jessica(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -192,7 +187,6 @@ def test_items_plumbus_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -233,7 +227,6 @@ def test_items_with_missing_x_token_header(client: TestClient):
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -262,7 +255,6 @@ def test_items_plumbus_with_missing_x_token_header(client: TestClient):
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -297,7 +289,6 @@ def test_root_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -326,14 +317,12 @@ def test_put_no_header(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index c0b77d4a722424b186a756fbd6c15ed95b4074c1..4e2e3e74d783ee530465a656e2e5652198789c6b 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_users_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -64,7 +62,6 @@ def test_users_foo_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -99,7 +96,6 @@ def test_users_me_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -145,7 +141,6 @@ def test_items_with_no_token_jessica(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -192,7 +187,6 @@ def test_items_plumbus_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -233,7 +227,6 @@ def test_items_with_missing_x_token_header(client: TestClient):
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -262,7 +255,6 @@ def test_items_plumbus_with_missing_x_token_header(client: TestClient):
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -297,7 +289,6 @@ def test_root_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -326,14 +317,12 @@ def test_put_no_header(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 948331b5ddfd364822cf58dcdd0fdbce331ce979..8c9e976df23d60d0d2e8fdf7f56c90713a095a8e 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -33,7 +32,6 @@ def test_users_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -70,7 +68,6 @@ def test_users_foo_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -107,7 +104,6 @@ def test_users_me_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -156,7 +152,6 @@ def test_items_with_no_token_jessica(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -206,7 +201,6 @@ def test_items_plumbus_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -250,7 +244,6 @@ def test_items_with_missing_x_token_header(client: TestClient):
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -280,7 +273,6 @@ def test_items_plumbus_with_missing_x_token_header(client: TestClient):
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -317,7 +309,6 @@ def test_root_with_no_token(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -347,14 +338,12 @@ def test_put_no_header(client: TestClient):
                     "loc": ["query", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 2476b773f40704f8c89f41fe9f721d4d0ffcc6b3..0d55d73ebe1b33bcff2cdd74eda3479ad6fd1173 100644 (file)
@@ -3,7 +3,6 @@ from unittest.mock import patch
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture
@@ -74,7 +73,6 @@ def test_post_with_only_name(client: TestClient):
                     "loc": ["body", "price"],
                     "msg": "Field required",
                     "input": {"name": "Foo"},
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -103,7 +101,6 @@ def test_post_with_only_name_price(client: TestClient):
                     "loc": ["body", "price"],
                     "msg": "Input should be a valid number, unable to parse string as a number",
                     "input": "twenty",
-                    "url": match_pydantic_error_url("float_parsing"),
                 }
             ]
         }
@@ -132,14 +129,12 @@ def test_post_with_no_data(client: TestClient):
                     "loc": ["body", "name"],
                     "msg": "Field required",
                     "input": {},
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "price"],
                     "msg": "Field required",
                     "input": {},
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -173,7 +168,6 @@ def test_post_with_none(client: TestClient):
                     "loc": ["body"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -244,7 +238,6 @@ def test_post_form_for_json(client: TestClient):
                     "loc": ["body"],
                     "msg": "Input should be a valid dictionary or object to extract fields from",
                     "input": "name=Foo&price=50.5",
-                    "url": match_pydantic_error_url("model_attributes_type"),
                 }
             ]
         }
@@ -308,9 +301,6 @@ def test_wrong_headers(client: TestClient):
                     "loc": ["body"],
                     "msg": "Input should be a valid dictionary or object to extract fields from",
                     "input": '{"name": "Foo", "price": 50.5}',
-                    "url": match_pydantic_error_url(
-                        "model_attributes_type"
-                    ),  # "https://errors.pydantic.dev/0.38.0/v/dict_attributes_type",
                 }
             ]
         }
@@ -339,7 +329,6 @@ def test_wrong_headers(client: TestClient):
                     "loc": ["body"],
                     "msg": "Input should be a valid dictionary or object to extract fields from",
                     "input": '{"name": "Foo", "price": 50.5}',
-                    "url": match_pydantic_error_url("model_attributes_type"),
                 }
             ]
         }
@@ -367,7 +356,6 @@ def test_wrong_headers(client: TestClient):
                     "loc": ["body"],
                     "msg": "Input should be a valid dictionary or object to extract fields from",
                     "input": '{"name": "Foo", "price": 50.5}',
-                    "url": match_pydantic_error_url("model_attributes_type"),
                 }
             ]
         }
index b64d860053515c982c1ae8898f2480b9dd7c6f10..4b9c128063f0044470e2f3606d637739cfb20b2e 100644 (file)
@@ -3,7 +3,6 @@ from unittest.mock import patch
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -81,7 +80,6 @@ def test_post_with_only_name(client: TestClient):
                     "loc": ["body", "price"],
                     "msg": "Field required",
                     "input": {"name": "Foo"},
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -111,7 +109,6 @@ def test_post_with_only_name_price(client: TestClient):
                     "loc": ["body", "price"],
                     "msg": "Input should be a valid number, unable to parse string as a number",
                     "input": "twenty",
-                    "url": match_pydantic_error_url("float_parsing"),
                 }
             ]
         }
@@ -141,14 +138,12 @@ def test_post_with_no_data(client: TestClient):
                     "loc": ["body", "name"],
                     "msg": "Field required",
                     "input": {},
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "price"],
                     "msg": "Field required",
                     "input": {},
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -183,7 +178,6 @@ def test_post_with_none(client: TestClient):
                     "loc": ["body"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -256,7 +250,6 @@ def test_post_form_for_json(client: TestClient):
                     "loc": ["body"],
                     "msg": "Input should be a valid dictionary or object to extract fields from",
                     "input": "name=Foo&price=50.5",
-                    "url": match_pydantic_error_url("model_attributes_type"),
                 }
             ]
         }
@@ -324,7 +317,6 @@ def test_wrong_headers(client: TestClient):
                     "loc": ["body"],
                     "msg": "Input should be a valid dictionary or object to extract fields from",
                     "input": '{"name": "Foo", "price": 50.5}',
-                    "url": match_pydantic_error_url("model_attributes_type"),
                 }
             ]
         }
@@ -353,7 +345,6 @@ def test_wrong_headers(client: TestClient):
                     "loc": ["body"],
                     "msg": "Input should be a valid dictionary or object to extract fields from",
                     "input": '{"name": "Foo", "price": 50.5}',
-                    "url": match_pydantic_error_url("model_attributes_type"),
                 }
             ]
         }
@@ -381,7 +372,6 @@ def test_wrong_headers(client: TestClient):
                     "loc": ["body"],
                     "msg": "Input should be a valid dictionary or object to extract fields from",
                     "input": '{"name": "Foo", "price": 50.5}',
-                    "url": match_pydantic_error_url("model_attributes_type"),
                 }
             ]
         }
index 1ff2d95760b9b33a7fd94488e6d13dee856782f7..fd6139eb9b771fab66a60fefea79e9f07f1b4616 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -57,7 +56,6 @@ def test_invalid_price(client: TestClient):
                     "msg": "Input should be greater than 0",
                     "input": -3.0,
                     "ctx": {"gt": 0.0},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
index 907d6842a42fea0e4718c9dcf40ac26d2d3742be..72c18c1f73a12bc2cd60371fc0b805a556880056 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -57,7 +56,6 @@ def test_invalid_price(client: TestClient):
                     "msg": "Input should be greater than 0",
                     "input": -3.0,
                     "ctx": {"gt": 0.0},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
index 431d2d1819468429fcca2611561a3b8fa3927929..1bc62868fd6c936d9c47f22f79b00e0e2b3b507e 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -62,7 +61,6 @@ def test_invalid_price(client: TestClient):
                     "msg": "Input should be greater than 0",
                     "input": -3.0,
                     "ctx": {"gt": 0.0},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
index 8cef6c154c9cc4ac935e04629424ff60b7d49086..3c5557a1b25baec8487e8a5d37656f43beafcfc7 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -62,7 +61,6 @@ def test_invalid_price(client: TestClient):
                     "msg": "Input should be greater than 0",
                     "input": -3.0,
                     "ctx": {"gt": 0.0},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
index b48cd9ec26d921f6675c4b6aa53f27adcd29cc3a..8c1386aa673bc15abbb9148af910e3c642c06eae 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -62,7 +61,6 @@ def test_invalid_price(client: TestClient):
                     "msg": "Input should be greater than 0",
                     "input": -3.0,
                     "ctx": {"gt": 0.0},
-                    "url": match_pydantic_error_url("greater_than"),
                 }
             ]
         }
index e5dc13b268e7d04c11685a5c0366f12f13d40436..6275ebe95fbbb94765e74eb6d1f2175bce82d5c6 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -50,7 +49,6 @@ def test_post_id_foo(client: TestClient):
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index 51e8e3a4e9977ed1e8b7dc3c8c35fa2f6524c5ed..5cd3e2c4aa911733552658693d1611729b2b9a17 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -50,7 +49,6 @@ def test_post_id_foo(client: TestClient):
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index 8ac1f726185512aaa6291f94fa8c85b56911d138..0173ab21b3ae568aa272ea5d34e8c017f0a8f47d 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -56,7 +55,6 @@ def test_post_id_foo(client: TestClient):
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index 7ada42c528b54ef9942c7d1cf53a73335222e01b..cda19918acb3e5a79603ad86fa926e065e44c78a 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -56,7 +55,6 @@ def test_post_id_foo(client: TestClient):
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index 0a832eaf6f0ffb4a33365a0837f9880cc1e08f5d..6632919331548c8791e4290ae6db243a4a280790 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -56,7 +55,6 @@ def test_post_id_foo(client: TestClient):
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index 2046579a94c415a5a3298219a3fe1fe01eb00f23..c26f8b89bce374056136129dda8261440e557151 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -46,21 +45,18 @@ def test_post_body_no_data(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -99,21 +95,18 @@ def test_post_body_empty_list(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 1282483e0732b447535b7e304c2d125be9e5c2a1..62c7e2fad8efe25526d0218dbc2253c67521740e 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -46,21 +45,18 @@ def test_post_body_no_data(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -99,21 +95,18 @@ def test_post_body_empty_list(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 577c079d00fbdf223e85313b8679e691db82a6e0..f46430fb5ac5ae6e5d13d0330f7624a7a99d2a5e 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -50,21 +49,18 @@ def test_post_body_no_data(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -104,21 +100,18 @@ def test_post_body_empty_list(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 0ec04151ccf4c6169c3bf090d352d44f0496385b..29071cddca700afc56e63a6157a0cdf7af01090b 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -50,21 +49,18 @@ def test_post_body_no_data(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -104,21 +100,18 @@ def test_post_body_empty_list(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 9caf5fe6cbe1307b98c74f79869a633445a6ba7f..133afe9b5e09b55095fb86d4325a3365289ddaf3 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -50,21 +49,18 @@ def test_post_body_no_data(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -104,21 +100,18 @@ def test_post_body_empty_list(client: TestClient):
                     "loc": ["body", "item"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "user"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "importance"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index f4a76be4496baf1cd9ae13f19adb339ef8dbc75f..762073aea6a70d674a17200b95ff811436133c05 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -31,7 +30,6 @@ def test_post_invalid_body(client: TestClient):
                     "loc": ["body", "foo", "[key]"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index 8ab9bcac83b1a01d31041c14f8c6a6315d9a0269..24623ceccb0835d88388972a4da05116e34b5f50 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -35,7 +34,6 @@ def test_post_invalid_body(client: TestClient):
                     "loc": ["body", "foo", "[key]"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index ad142ec887fae29b513b0f1782453db18d946afb..6f7355aaa1db997a890c0f78e3a5b7fa30b08cbf 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.custom_request_and_route.tutorial002 import app
 
@@ -23,7 +22,6 @@ def test_exception_handler_body_access():
                         "loc": ["body"],
                         "msg": "Input should be a valid list",
                         "input": {"numbers": [1, 2, 3]},
-                        "url": match_pydantic_error_url("list_type"),
                     }
                 ],
                 "body": '{"numbers": [1, 2, 3]}',
index 9f1200f373c912196f651d824569065c920be8c4..762654d29d77d818d27918292813d9e2e2ae8d6e 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.dataclasses.tutorial001 import app
 
@@ -29,7 +28,6 @@ def test_post_invalid_item():
                     "loc": ["body", "price"],
                     "msg": "Input should be a valid number, unable to parse string as a number",
                     "input": "invalid price",
-                    "url": match_pydantic_error_url("float_parsing"),
                 }
             ]
         }
index 704e389a5bbfcdeadeb025a56c12438aa7f3a344..5f14d9a3baccc5ef2c492ff4c0976b034aba10ad 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.dependencies.tutorial006 import app
 
@@ -18,14 +17,12 @@ def test_get_no_headers():
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-key"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 5034fceba5e259e132020962e6c01402cd619d04..a307ff8087fb6588ae9a60961b1ef34c38682442 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.dependencies.tutorial006_an import app
 
@@ -18,14 +17,12 @@ def test_get_no_headers():
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-key"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 3fc22dd3c2e6f0dc7f38d9ac246525eb8a68c1fa..b41b1537ec99c9b68eae3a237efdd6cc8358feda 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -26,14 +25,12 @@ def test_get_no_headers(client: TestClient):
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-key"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 753e62e43e408ed667bc3658f91be392efc5095a..6b53c83bb5cca8c858e3d36e3a54c47bf14b2f29 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.dependencies.tutorial012 import app
 
@@ -18,14 +17,12 @@ def test_get_no_headers_items():
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-key"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -59,14 +56,12 @@ def test_get_no_headers_users():
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-key"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 4157d46128bf689e761e10379be52dce38856380..75adb69fc7ba7e1f273dced097c7c5aed41325c2 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.dependencies.tutorial012_an import app
 
@@ -18,14 +17,12 @@ def test_get_no_headers_items():
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-key"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -59,14 +56,12 @@ def test_get_no_headers_users():
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-key"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 9e46758cbdd76783bd3858854ee384802360bc83..e0a3d1ec277167ce500594c3517c87470b56db78 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -26,14 +25,12 @@ def test_get_no_headers_items(client: TestClient):
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-key"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -68,14 +65,12 @@ def test_get_no_headers_users(client: TestClient):
                     "loc": ["header", "x-token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["header", "x-key"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 494c317cabe62ffe3b17a68d227db106adc4e67e..581b2e4c75178780320aab754447fd3b20a8eb35 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.handling_errors.tutorial005 import app
 
@@ -18,7 +17,6 @@ def test_post_validation_error():
                     "loc": ["body", "size"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "XL",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ],
             "body": {"title": "towel", "size": "XL"},
index cc2b496a839afdde16dfd3db9b3aa3a06f54948d..7d2f553aac8f449338309cb700f1735e0f39858c 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.handling_errors.tutorial006 import app
 
@@ -18,7 +17,6 @@ def test_get_validation_error():
                     "loc": ["path", "item_id"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "foo",
-                    "url": match_pydantic_error_url("int_parsing"),
                 }
             ]
         }
index 2d280226914293541a640e2fc84c1e35ecc0ea4a..8240b60a62da9737dbca0a92dc99bb3cd34713cc 100644 (file)
@@ -1,6 +1,5 @@
 import pytest
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_pydanticv2
 
@@ -64,7 +63,6 @@ def test_post_invalid(client: TestClient):
                 "loc": ["tags", 3],
                 "msg": "Input should be a valid string",
                 "input": {"sneaky": "object"},
-                "url": match_pydantic_error_url("string_type"),
             }
         ]
     }
index 9215863576349223bf0b5279534213d0c56a5146..05ae85b451fa78a243f72f92c41efcf15ec43696 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.query_params.tutorial005 import app
 
@@ -24,7 +23,6 @@ def test_foo_no_needy():
                     "loc": ["query", "needy"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index e07803d6c9b5f9efaee4990a6560405f444aa411..dbd63da1608278e264134331a2630932390f6e7d 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -34,21 +33,18 @@ def test_foo_no_needy(client: TestClient):
                     "loc": ["query", "needy"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "int_parsing",
                     "loc": ["query", "skip"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "a",
-                    "url": match_pydantic_error_url("int_parsing"),
                 },
                 {
                     "type": "int_parsing",
                     "loc": ["query", "limit"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "b",
-                    "url": match_pydantic_error_url("int_parsing"),
                 },
             ]
         }
index 6c4c0b4dc8927468cbc98c18e3afe58e73b3ebd8..5055e380523ea835ad20000af598daf14d3e65a9 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -38,21 +37,18 @@ def test_foo_no_needy(client: TestClient):
                     "loc": ["query", "needy"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "int_parsing",
                     "loc": ["query", "skip"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "a",
-                    "url": match_pydantic_error_url("int_parsing"),
                 },
                 {
                     "type": "int_parsing",
                     "loc": ["query", "limit"],
                     "msg": "Input should be a valid integer, unable to parse string as an integer",
                     "input": "b",
-                    "url": match_pydantic_error_url("int_parsing"),
                 },
             ]
         }
index 287c2e8f8e9e0ae299387dba97997503dcedc89b..945cee3d2628299bcae8f121aa40bfb0807a75bc 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -45,7 +44,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
                     "msg": "String should match pattern '^fixedquery$'",
                     "input": "nonregexquery",
                     "ctx": {"pattern": "^fixedquery$"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index 5b0515070ab6079eb785c96f7c6810ffe63b5906..23951a9aa37b15beabf355a29d65dbd9d5b96640 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -45,7 +44,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
                     "msg": "String should match pattern '^fixedquery$'",
                     "input": "nonregexquery",
                     "ctx": {"pattern": "^fixedquery$"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index d22b1ce204a11d759b1d896ee45fccae72ead789..2968af563c864a0326a35720e0675bbc3ad3f75f 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -51,7 +50,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
                     "msg": "String should match pattern '^fixedquery$'",
                     "input": "nonregexquery",
                     "ctx": {"pattern": "^fixedquery$"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index 3e7d5d3adbe63bd02e63edbb3349bdc3ff2f1f78..534ba87594ee0c81f1273ac87f857b7c49e68395 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -51,7 +50,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
                     "msg": "String should match pattern '^fixedquery$'",
                     "input": "nonregexquery",
                     "ctx": {"pattern": "^fixedquery$"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index 1c3a09d399f46c64a0c725841d0dc7edb45974f4..886bceca21de3e3dc86e2501aa2d7850789b826c 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py310
 
@@ -51,7 +50,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
                     "msg": "String should match pattern '^fixedquery$'",
                     "input": "nonregexquery",
                     "ctx": {"pattern": "^fixedquery$"},
-                    "url": match_pydantic_error_url("string_pattern_mismatch"),
                 }
             ]
         }
index 91cc2b6365a16a869d8226fee2fe3fc39a741543..f5817593bbf885ad5aa7748a0084d63bd23fbe38 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.request_files.tutorial001 import app
 
@@ -29,7 +28,6 @@ def test_post_form_no_body():
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -58,7 +56,6 @@ def test_post_body_json():
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index 3021eb3c3c98e33e5d6afcbb74fbaa8fbf6d4b22..1c78e3679e3a30e315909b81e3ac905f360c62d0 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.request_files.tutorial001_an import app
 
@@ -18,7 +17,6 @@ def test_post_form_no_body():
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -47,7 +45,6 @@ def test_post_body_json():
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index 04f3a4693bfcf6ad76590d4345181ed853041fc8..843fcec28706b2d4d722146c137361fc52accc56 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -26,7 +25,6 @@ def test_post_form_no_body(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -56,7 +54,6 @@ def test_post_body_json(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index ed9680b62b78e284a819fa0245033fe33df015ff..db1552e5c661046399c258c9da89869871627490 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.request_files.tutorial002 import app
 
@@ -18,7 +17,6 @@ def test_post_form_no_body():
                     "loc": ["body", "files"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -47,7 +45,6 @@ def test_post_body_json():
                     "loc": ["body", "files"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index ea8c1216c0e42b5cccb128692e1c01fc0c928e39..b16da16691a30e756414d34c17e1124bb11065ba 100644 (file)
@@ -1,6 +1,5 @@
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from docs_src.request_files.tutorial002_an import app
 
@@ -18,7 +17,6 @@ def test_post_form_no_body():
                     "loc": ["body", "files"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -47,7 +45,6 @@ def test_post_body_json():
                     "loc": ["body", "files"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index 6d587783677ecbc14e00f1e66ea333aabd4dfcc3..e092a516d5d8a5cfe2f2fdfe6095a82e240b2bcd 100644 (file)
@@ -2,7 +2,6 @@ import pytest
 from dirty_equals import IsDict
 from fastapi import FastAPI
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -32,7 +31,6 @@ def test_post_form_no_body(client: TestClient):
                     "loc": ["body", "files"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -62,7 +60,6 @@ def test_post_body_json(client: TestClient):
                     "loc": ["body", "files"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index 2d0445421b54b81993976da05a55580138f42585..341a9ac8eddca161b6b0a455ad5bd04ffb4152a0 100644 (file)
@@ -2,7 +2,6 @@ import pytest
 from dirty_equals import IsDict
 from fastapi import FastAPI
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -43,7 +42,6 @@ def test_post_form_no_body(client: TestClient):
                     "loc": ["body", "files"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -73,7 +71,6 @@ def test_post_body_json(client: TestClient):
                     "loc": ["body", "files"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
index 805daeb10ff2e5fb9f3a90852c8341d44881aa2a..cbef9d30fbd3ee6e0384d8fcaf55aad2917a083c 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_post_body_form_no_password(client: TestClient):
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -58,7 +56,6 @@ def test_post_body_form_no_username(client: TestClient):
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -87,14 +84,12 @@ def test_post_body_form_no_data(client: TestClient):
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -128,14 +123,12 @@ def test_post_body_json(client: TestClient):
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index c43a0b69558027d6dff7d292a49c1bbfe3434887..88b8452bca24b4521a5eee1da085bf99baf86790 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_post_body_form_no_password(client: TestClient):
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -58,7 +56,6 @@ def test_post_body_form_no_username(client: TestClient):
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -87,14 +84,12 @@ def test_post_body_form_no_data(client: TestClient):
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -128,14 +123,12 @@ def test_post_body_json(client: TestClient):
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 078b812aa5b28e4a661d4c8c0580c5eb2381fd85..3229897c9f64a8df290efd9572e8fef6d20b4248 100644 (file)
@@ -1,7 +1,6 @@
 import pytest
 from dirty_equals import IsDict
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -33,7 +32,6 @@ def test_post_body_form_no_password(client: TestClient):
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -63,7 +61,6 @@ def test_post_body_form_no_username(client: TestClient):
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 }
             ]
         }
@@ -93,14 +90,12 @@ def test_post_body_form_no_data(client: TestClient):
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -135,14 +130,12 @@ def test_post_body_json(client: TestClient):
                     "loc": ["body", "username"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "password"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index cac58639f1fcd34face76c3718319b35d1a4b610..1e1ad2a872b5ff2f5a219e674ca6dad6654e9297 100644 (file)
@@ -2,7 +2,6 @@ import pytest
 from dirty_equals import IsDict
 from fastapi import FastAPI
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="app")
@@ -29,21 +28,18 @@ def test_post_form_no_body(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -82,14 +78,12 @@ def test_post_form_no_file(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -123,21 +117,18 @@ def test_post_body_json(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -181,14 +172,12 @@ def test_post_file_no_token(tmp_path, app: FastAPI):
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 009568048ee4050fc4eeed55260b28c1ff3cd9d8..5daf4dbf49a2e7c1ea0f88035771c21e52328131 100644 (file)
@@ -2,7 +2,6 @@ import pytest
 from dirty_equals import IsDict
 from fastapi import FastAPI
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 
 @pytest.fixture(name="app")
@@ -29,21 +28,18 @@ def test_post_form_no_body(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -82,14 +78,12 @@ def test_post_form_no_file(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -123,21 +117,18 @@ def test_post_body_json(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -181,14 +172,12 @@ def test_post_file_no_token(tmp_path, app: FastAPI):
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
index 3d007e90ba4f9f23ac6e01c30a7b60c9bbbe030d..3f1204efa7960fbf947133cf536fd13c42f5d966 100644 (file)
@@ -2,7 +2,6 @@ import pytest
 from dirty_equals import IsDict
 from fastapi import FastAPI
 from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
 
 from ...utils import needs_py39
 
@@ -32,21 +31,18 @@ def test_post_form_no_body(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -86,14 +82,12 @@ def test_post_form_no_file(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -128,21 +122,18 @@ def test_post_body_json(client: TestClient):
                     "loc": ["body", "file"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }
@@ -187,14 +178,12 @@ def test_post_file_no_token(tmp_path, app: FastAPI):
                     "loc": ["body", "fileb"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
                 {
                     "type": "missing",
                     "loc": ["body", "token"],
                     "msg": "Field required",
                     "input": None,
-                    "url": match_pydantic_error_url("missing"),
                 },
             ]
         }