What's Changed
Provides you with the ability to setup pydantic config using `inject`
python
inject(pydantic_config={"str_max_length": 8})
def limited_str(a: str):
...
limited_str("*" * 9) raises ValidationError
Also, added context manager method to override dependencies:
python
from fast_depends import Depends, dependency_provider, inject
def base_dep():
return 1
def override_dep():
return 2
inject
def func(d=Depends(base_dep)):
return d
with dependency_provider.scope(base_dep, override_dep):
assert func() == 2
assert func() == 1
* feat (38): add pydantic config option by Lancetnik in https://github.com/Lancetnik/FastDepends/pull/42
**Full Changelog**: https://github.com/Lancetnik/FastDepends/compare/2.2.5...2.2.6