Feature: 优先使用 Annotated 的最后一个子依赖 (#2360)

Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
Bryan不可思议
2023-09-14 00:14:45 +08:00
committed by GitHub
parent 0030bf725e
commit 7aaa66c8ba
4 changed files with 37 additions and 3 deletions

View File

@ -26,3 +26,14 @@ async def annotated_arg_str(key: Annotated[str, ArgStr()]) -> str:
async def annotated_arg_plain_text(key: Annotated[str, ArgPlainText()]) -> str:
return key
# test dependency priority
async def annotated_prior_arg(key: Annotated[str, ArgStr("foo")] = ArgPlainText()):
return key
async def annotated_multi_arg(
key: Annotated[Annotated[str, ArgStr("foo")], ArgPlainText()]
):
return key