]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
fix type UrlStr -> HttpUrl (#832)
authorDustyposa <zmzposa@outlook.com>
Wed, 8 Jan 2020 08:08:43 +0000 (16:08 +0800)
committerDavid Montague <35119617+dmontagu@users.noreply.github.com>
Wed, 8 Jan 2020 08:08:43 +0000 (00:08 -0800)
docs/src/body_nested_models/tutorial005.py
docs/src/body_nested_models/tutorial006.py
docs/src/body_nested_models/tutorial007.py
docs/src/body_nested_models/tutorial008.py
docs/tutorial/body-nested-models.md

index 3f0184168bc2d98ed1378ceaed0e197aae8ec4d3..afea77179a413c68d1626b19388e5e7d7901c401 100644 (file)
@@ -1,13 +1,13 @@
 from typing import Set
 
 from fastapi import FastAPI
-from pydantic import BaseModel, UrlStr
+from pydantic import BaseModel, HttpUrl
 
 app = FastAPI()
 
 
 class Image(BaseModel):
-    url: UrlStr
+    url: HttpUrl
     name: str
 
 
index d899571286cbda9bbb6b8701cec406efec3e097c..3d0db6e588804895f513ac8d18d864e738ee81a7 100644 (file)
@@ -1,13 +1,13 @@
 from typing import List, Set
 
 from fastapi import FastAPI
-from pydantic import BaseModel, UrlStr
+from pydantic import BaseModel, HttpUrl
 
 app = FastAPI()
 
 
 class Image(BaseModel):
-    url: UrlStr
+    url: HttpUrl
     name: str
 
 
index 0ddc6c6343078d1b74f6465fcc630bb750006c00..f13c07ad531b0cb55800785769c8c79f556ad825 100644 (file)
@@ -1,13 +1,13 @@
 from typing import List, Set
 
 from fastapi import FastAPI
-from pydantic import BaseModel, UrlStr
+from pydantic import BaseModel, HttpUrl
 
 app = FastAPI()
 
 
 class Image(BaseModel):
-    url: UrlStr
+    url: HttpUrl
     name: str
 
 
index ff501cee5d240780da01f31dafdfb6f40797192f..b6f5c0660b7d97c91178f144a5ef8bb72234045e 100644 (file)
@@ -1,13 +1,13 @@
 from typing import List
 
 from fastapi import FastAPI
-from pydantic import BaseModel, UrlStr
+from pydantic import BaseModel, HttpUrl
 
 app = FastAPI()
 
 
 class Image(BaseModel):
-    url: UrlStr
+    url: HttpUrl
     name: str
 
 
index 8b874b6ec499d5f536039321bb0839f0ceb57663..0ae6999219d7641f849e743c54dfab06a517a506 100644 (file)
@@ -118,7 +118,7 @@ Apart from normal singular types like `str`, `int`, `float`, etc. You can use mo
 
 To see all the options you have, checkout the docs for <a href="https://pydantic-docs.helpmanual.io/#exotic-types" target="_blank">Pydantic's exotic types</a>. You will see some examples in the next chapter.
 
-For example, as in the `Image` model we have a `url` field, we can declare it to be instead of a `str`, a Pydantic's `UrlStr`:
+For example, as in the `Image` model we have a `url` field, we can declare it to be instead of a `str`, a Pydantic's `HttpUrl`:
 
 ```Python hl_lines="4 10"
 {!./src/body_nested_models/tutorial005.py!}