From f4880f1f9c9f019d4f689babbe9d62baf7bfd454 Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Mon, 22 Nov 2021 20:09:57 +0100 Subject: [PATCH] [lib.domain] wraps function when loading routes from modules, to get the real name --- halfapi/lib/domain.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/halfapi/lib/domain.py b/halfapi/lib/domain.py index f1cb077..9895e1b 100644 --- a/halfapi/lib/domain.py +++ b/halfapi/lib/domain.py @@ -8,6 +8,7 @@ import re import sys import importlib import inspect +from functools import wraps from types import ModuleType, FunctionType from typing import Coroutine, Generator from typing import Dict, List, Tuple, Iterator @@ -45,6 +46,7 @@ def route_decorator(fct: FunctionType, ret_type: str = 'json') -> Coroutine: """ Returns an async function that can be mounted on a router """ if ret_type == 'json': + @wraps(fct) @acl.args_check async def wrapped(request, *args, **kwargs): fct_args_spec = inspect.getfullargspec(fct).args