From 7492af5acf20c4d325ec863b9987f6107a05abd7 Mon Sep 17 00:00:00 2001 From: Vincent Maillol Date: Sat, 27 Mar 2021 12:34:39 +0100 Subject: [PATCH] Update version 1.8.1 --- README.rst | 5 ++++- aiohttp_pydantic/__init__.py | 2 +- tests/test_validation_query_string.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 7ad0c03..a0a2f43 100644 --- a/README.rst +++ b/README.rst @@ -137,8 +137,11 @@ the List type .. code-block:: python3 + from typing import List + from pydantic import Field + class AccountView(PydanticView): - async def get(self, tags: List[str] = []): + async def get(self, tags: List[str] = Field(default_factory=list)): ... app = web.Application() diff --git a/aiohttp_pydantic/__init__.py b/aiohttp_pydantic/__init__.py index 0524b62..b8a6eec 100644 --- a/aiohttp_pydantic/__init__.py +++ b/aiohttp_pydantic/__init__.py @@ -1,5 +1,5 @@ from .view import PydanticView -__version__ = "1.8.0" +__version__ = "1.8.1" __all__ = ("PydanticView", "__version__") diff --git a/tests/test_validation_query_string.py b/tests/test_validation_query_string.py index b25ff43..57d886e 100644 --- a/tests/test_validation_query_string.py +++ b/tests/test_validation_query_string.py @@ -1,5 +1,5 @@ from typing import Optional, List - +from pydantic import Field from aiohttp import web from aiohttp_pydantic import PydanticView @@ -11,7 +11,7 @@ class ArticleView(PydanticView): with_comments: bool, age: Optional[int] = None, nb_items: int = 7, - tags: List[str] = [], + tags: List[str] = Field(default_factory=list) ): return web.json_response( {