Lancetnik / FastDepends

FastDepends - FastAPI Dependency Injection system extracted from FastAPI and cleared of all HTTP logic. Async and sync modes are both supported.
https://lancetnik.github.io/FastDepends/
MIT License
281 stars 10 forks source link

bug: CustomFields can mix up arguments #112

Closed Lancetnik closed 1 month ago

Lancetnik commented 1 month ago

Source Issue: https://github.com/airtai/faststream/issues/1558

The following native FastDepends sometimes failures and reproduces the problem above

from fast_depends import inject
from fast_depends.library import CustomField

@inject
def func(
    b: int = CustomField(),
    a: int = CustomField(),
):
    assert b == 2
    assert a == 1

func(2, 1)