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

Integration with Dependency Injector

KurganskyVladimir opened this issue · comments

There is an issue to use aiohttp-pydantic with (dependency-injector).
The issue is in pydantic exception about DI params, which will be injected.
In order to fix it, we need to override PydanticView logic in static method parse_func_signature (actually in injectors module, _parse_func_signature). We need to have a mechanism to skip DI and our custom classes/types in order to allow DI inject services/resources to aiohttp handlers.

There is a fix with defining our custom 'PydanticView'-like class, but in this case we need to override almost all oas package too, because there is a call of is_pydantic_view function to build spec in generate_oas.