Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: use_args() got an unexpected keyword argument 'locations' #117

Closed
revmischa opened this issue Jan 7, 2020 · 2 comments · Fixed by #132
Closed

TypeError: use_args() got an unexpected keyword argument 'locations' #117

revmischa opened this issue Jan 7, 2020 · 2 comments · Fixed by #132
Milestone

Comments

@revmischa
Copy link

    def decorator(func):
    
        @wraps(func)
        def wrapper(*f_args, **f_kwargs):
            return func(*f_args, **f_kwargs)
    
        # Add parameter to parameters list in doc info in function object
        # The deepcopy avoids modifying the wrapped function doc
        wrapper._apidoc = deepcopy(getattr(wrapper, '_apidoc', {}))
        wrapper._apidoc.setdefault('parameters', []).append(parameters)
    
        # Call use_args (from webargs) to inject params in function
        return self.ARGUMENTS_PARSER.use_args(
>           schema, locations=[location], **kwargs)(wrapper)
E       TypeError: use_args() got an unexpected keyword argument 'locations'

../../../.virtualenvs/jAjXlZQO/lib/python3.7/site-packages/flask_smorest/arguments.py:76: TypeError
@revmischa
Copy link
Author

Downgrading webargs to 5.4.0 fixes it
Yay breaking changes

@lafrech
Copy link
Member

lafrech commented Jan 7, 2020

Indeed.

The fix is easy. See my comment here.

You're using a beta webargs version. As soon as webargs 6.0.0 is out, I'll release a flask-smorest version including the fix and drop webargs < 6.0.0 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants