From: Dustyposa Date: Wed, 8 Jan 2020 08:08:43 +0000 (+0800) Subject: fix type UrlStr -> HttpUrl (#832) X-Git-Tag: 0.46.0~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d3dcbcd1bb93bc0563eea5e98688d9dc4867e00;p=thirdparty%2Ffastapi%2Ffastapi.git fix type UrlStr -> HttpUrl (#832) --- diff --git a/docs/src/body_nested_models/tutorial005.py b/docs/src/body_nested_models/tutorial005.py index 3f0184168b..afea77179a 100644 --- a/docs/src/body_nested_models/tutorial005.py +++ b/docs/src/body_nested_models/tutorial005.py @@ -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 diff --git a/docs/src/body_nested_models/tutorial006.py b/docs/src/body_nested_models/tutorial006.py index d899571286..3d0db6e588 100644 --- a/docs/src/body_nested_models/tutorial006.py +++ b/docs/src/body_nested_models/tutorial006.py @@ -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 diff --git a/docs/src/body_nested_models/tutorial007.py b/docs/src/body_nested_models/tutorial007.py index 0ddc6c6343..f13c07ad53 100644 --- a/docs/src/body_nested_models/tutorial007.py +++ b/docs/src/body_nested_models/tutorial007.py @@ -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 diff --git a/docs/src/body_nested_models/tutorial008.py b/docs/src/body_nested_models/tutorial008.py index ff501cee5d..b6f5c0660b 100644 --- a/docs/src/body_nested_models/tutorial008.py +++ b/docs/src/body_nested_models/tutorial008.py @@ -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 diff --git a/docs/tutorial/body-nested-models.md b/docs/tutorial/body-nested-models.md index 8b874b6ec4..0ae6999219 100644 --- a/docs/tutorial/body-nested-models.md +++ b/docs/tutorial/body-nested-models.md @@ -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 Pydantic's exotic types. 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!}