Skip to content

Docs: Function decorator order should be specified #341

@malikoth

Description

@malikoth

I just spent some time trying to figure out why my @params function decorator didn't seem to be doing anything. My conclusion was that I put @params between the function signature, and the @get('some_endpoint') decorator. The @get has to be closest to the signature, and other decorators must be placed above that.

Wrong:

    @get('some_endpoint')
    @params({'key': 'value'})
    def some_func(self):
        """Call some endpoint"""

Right:

    @params({'key': 'value'})
    @get('some_endpoint')
    def some_func(self):
        """Call some endpoint"""

I think this should be called out in the documentation somewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions