diff --git a/doc/api.rst b/doc/api.rst index 1297915..dc61f98 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -9,7 +9,7 @@ Public API .. module:: wsme -.. autoclass:: signature([return_type, [arg0_type, [arg1_type, ... ] ] ], body=None, status=None) +.. autoclass:: signature([return_type, [arg0_type, [arg1_type, ... ] ] ], body=None, status_code=None) .. autoclass:: wsme.types.Base .. autoclass:: wsattr diff --git a/wsme/api.py b/wsme/api.py index bd4631f..4aab9a4 100644 --- a/wsme/api.py +++ b/wsme/api.py @@ -141,14 +141,14 @@ class FunctionDefinition(object): class signature(object): - """ - Decorator that specify the argument types of an exposed function. + + """Decorator that specify the argument types of an exposed function. :param return_type: Type of the value returned by the function :param argN: Type of the Nth argument :param body: If the function takes a final argument that is supposed to be the request body by itself, its type. - :param status: HTTP return status code of the function. + :param status_code: HTTP return status code of the function. :param ignore_extra_args: Allow extra/unknow arguments (default to False) Most of the time this decorator is not supposed to be used directly, @@ -158,6 +158,7 @@ class signature(object): decororator, either a new decorator named @wsexpose that takes the same parameters (it will in addition expose the function, hence its name). """ + def __init__(self, *types, **options): self.return_type = types[0] if types else None self.arg_types = []