Maillol / aiohttp-pydantic

Aiohttp View that validates request body and query sting regarding the annotations declared in the View method

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It would be nice to be able to use an input model for GET requests too.

jalelegenda opened this issue · comments

This is a feature request, but it'd be nice to be able to use an input model as opposed to e.g. 10 parameters for GET requests.

In order to group parameters like this ?

>>> class Pagination(GroupParameters):
...     page: int = 0
...     nb_elements_per_pages: int = 10
... 

class ArticleView(PydanticView):
    async def get(self, pagination: Pagination):
        return web.json_response({'with_comments': with_comments})