Skip to content

Inspect parameters from tornado handler method with coroutine #99

@lordent

Description

@lordent

When used @gen.coroutine or similar decorator on handler method

@gen.coroutine
def get(self, item_id):

inspect.getargspec function (tornado plugin) return decorated arguments, and then we got empty list

args = inspect.getargspec(method).args[1:]

And error like this, when used function spec.add_path

raise APISpecError('Path template is not specified')

It fixed If use more common function signature from inspect module,
For example

args = list(inspect.signature(method).parameters.keys())[1:]

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions