Fix - Does not work with from __future__ import annotations
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from aiohttp_pydantic.injectors import (
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Iterator, List, Optional
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from aiohttp_pydantic import PydanticView
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
from aiohttp_pydantic import PydanticView
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
from textwrap import dedent
|
||||
from io import StringIO
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from textwrap import dedent
|
||||
|
||||
from aiohttp_pydantic.oas.docstring_parser import (
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from aiohttp_pydantic.oas.struct import OpenApiSpec3
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from aiohttp_pydantic.oas.struct import OpenApiSpec3
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from aiohttp_pydantic.oas.struct import OpenApiSpec3
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from typing import List, Optional, Union, Literal
|
||||
from uuid import UUID
|
||||
@@ -385,15 +387,16 @@ async def test_generated_view_info_as_title():
|
||||
}
|
||||
|
||||
|
||||
class Pagination(Group):
|
||||
page: int = 1
|
||||
page_size: int = 20
|
||||
|
||||
|
||||
async def test_use_parameters_group_should_not_impact_the_oas(aiohttp_client):
|
||||
class PetCollectionView1(PydanticView):
|
||||
async def get(self, page: int = 1, page_size: int = 20) -> r200[List[Pet]]:
|
||||
return web.json_response()
|
||||
|
||||
class Pagination(Group):
|
||||
page: int = 1
|
||||
page_size: int = 20
|
||||
|
||||
class PetCollectionView2(PydanticView):
|
||||
async def get(self, pagination: Pagination) -> r200[List[Pet]]:
|
||||
return web.json_response()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Iterator, List, Optional
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
from enum import Enum
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
from aiohttp_pydantic import PydanticView
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional, List
|
||||
from pydantic import Field
|
||||
from aiohttp import web
|
||||
|
||||
Reference in New Issue
Block a user