aiohttp-pydantic icon indicating copy to clipboard operation
aiohttp-pydantic copied to clipboard

Integration with Dependency Injector

Open KurganskyVladimir opened this issue 1 year ago • 0 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.

KurganskyVladimir avatar Mar 29 '23 07:03 KurganskyVladimir