From f424ad25a40009fe050697fca3a456161c6dbeb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:20:46 +0200 Subject: [PATCH] docstrings --- api/ovdashboard_api/routers/v1/_list_manager.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/ovdashboard_api/routers/v1/_list_manager.py b/api/ovdashboard_api/routers/v1/_list_manager.py index 67bea50..9849ff8 100644 --- a/api/ovdashboard_api/routers/v1/_list_manager.py +++ b/api/ovdashboard_api/routers/v1/_list_manager.py @@ -34,6 +34,10 @@ class ListManager: prefix: str, names: list[str] = Depends(lister.func), ) -> list[str]: + """ + Filters `names` from an async source for names starting with a given prefix. + """ + if isinstance(names, params.Depends): names = await lister.func() @@ -45,6 +49,12 @@ class ListManager: prefix: str, names: list[str] = Depends(_filter_fn), ) -> str: + """ + Determines if a given prefix is unique in the async produced list `names`. + + On success, produces the unique name with that prefix. Otherwise, throws a HTTPException. + """ + if isinstance(names, params.Depends): names = await _filter_fn(prefix)