]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Update example validation error from Pydantic v1 to match Pydantic v2 in `docs...
authorGiulio Davide Carparelli <giulio.davide.97@gmail.com>
Fri, 20 Oct 2023 09:08:42 +0000 (11:08 +0200)
committerGitHub <noreply@github.com>
Fri, 20 Oct 2023 09:08:42 +0000 (13:08 +0400)
docs/en/docs/tutorial/path-params.md
docs/en/docs/tutorial/query-params.md

index 6594a7a8b5f95c6dd145a8059bcfc04808ab2e8b..847b56334218efaabb7dda8e6bacce0997e77f47 100644 (file)
@@ -46,16 +46,18 @@ But if you go to the browser at <a href="http://127.0.0.1:8000/items/foo" class=
 
 ```JSON
 {
-    "detail": [
-        {
-            "loc": [
-                "path",
-                "item_id"
-            ],
-            "msg": "value is not a valid integer",
-            "type": "type_error.integer"
-        }
-    ]
+  "detail": [
+    {
+      "type": "int_parsing",
+      "loc": [
+        "path",
+        "item_id"
+      ],
+      "msg": "Input should be a valid integer, unable to parse string as an integer",
+      "input": "foo",
+      "url": "https://errors.pydantic.dev/2.1/v/int_parsing"
+    }
+  ]
 }
 ```
 
index 988ff4bf18c2561474b07060100de06c38d55178..bc3b11948a1177c60613ec90b101ea7349cafa32 100644 (file)
@@ -173,16 +173,18 @@ http://127.0.0.1:8000/items/foo-item
 
 ```JSON
 {
-    "detail": [
-        {
-            "loc": [
-                "query",
-                "needy"
-            ],
-            "msg": "field required",
-            "type": "value_error.missing"
-        }
-    ]
+  "detail": [
+    {
+      "type": "missing",
+      "loc": [
+        "query",
+        "needy"
+      ],
+      "msg": "Field required",
+      "input": null,
+      "url": "https://errors.pydantic.dev/2.1/v/missing"
+    }
+  ]
 }
 ```