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

Breaking Changes in webargs 6.0.0b1 (pre-release) #176

Closed
c-kruse opened this issue Jan 7, 2020 · 3 comments · Fixed by #177
Closed

Breaking Changes in webargs 6.0.0b1 (pre-release) #176

c-kruse opened this issue Jan 7, 2020 · 3 comments · Fixed by #177

Comments

@c-kruse
Copy link
Contributor

c-kruse commented Jan 7, 2020

Hello, just ran into this by accident and wanted to be sure this landed on your radar. Webargs has introduced a backwards-incompatible v6 pre-release. https://webargs.readthedocs.io/en/latest/changelog.html#b1-2020-01-06

You may want to pin webargs to <6.0.0 until you come up with a more thoughtful approach.

To Recreate

Example flask app:

from flask import Flask
from flask_apispec import use_kwargs
from marshmallow import fields

app = Flask(__name__)

@app.route('/')
@use_kwargs({'category': fields.Str(), 'size': fields.Str()})
def get_pets(**kwargs):
    return []

if __name__ == "__main__":
    app.run()

Dependencies: (requirements.txt)

apispec==3.2.0
Click==7.0
Flask==1.1.1
flask-apispec==0.8.5
itsdangerous==1.1.0
Jinja2==2.10.3
MarkupSafe==1.1.1
marshmallow==3.3.0
six==1.13.0
webargs==6.0.0b2
Werkzeug==0.16.0

Error:

 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2020-01-07 14:46:35,733] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/Users/christiankruse/Workspace/flask-apispec-webargs/.venv/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/christiankruse/Workspace/flask-apispec-webargs/.venv/lib/python3.8/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/christiankruse/Workspace/flask-apispec-webargs/.venv/lib/python3.8/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/christiankruse/Workspace/flask-apispec-webargs/.venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/Users/christiankruse/Workspace/flask-apispec-webargs/.venv/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/christiankruse/Workspace/flask-apispec-webargs/.venv/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/christiankruse/Workspace/flask-apispec-webargs/.venv/lib/python3.8/site-packages/flask_apispec/annotations.py", line 118, in wrapped
    return wrapper(*args, **kwargs)
  File "/Users/christiankruse/Workspace/flask-apispec-webargs/.venv/lib/python3.8/site-packages/flask_apispec/wrapper.py", line 32, in __call__
    response = self.call_view(*args, **kwargs)
  File "/Users/christiankruse/Workspace/flask-apispec-webargs/.venv/lib/python3.8/site-packages/flask_apispec/wrapper.py", line 46, in call_view
    parsed = parser.parse(schema, locations=option['kwargs']['locations'])
TypeError: parse() got an unexpected keyword argument 'locations'
127.0.0.1 - - [07/Jan/2020 14:46:35] "GET / HTTP/1.1" 500 -
@jtruty
Copy link

jtruty commented Feb 27, 2020

Got the same error and spent far too long debugging it.

@c-kruse
Copy link
Contributor Author

c-kruse commented Feb 29, 2020

Looks like webargs released 6.0.0 yesterday! This is no longer just an issue with a pre-release package. Anyone installing flask-apispec without an explicit pip install "webargs<6.0.0" will run into this issue.

@sloria
Copy link
Collaborator

sloria commented Mar 1, 2020

flask-apispec 0.8.6 restricts the webargs version to <6.0. I'll open a new issue to fix compatibility with >=6.0

jollysahil pushed a commit to levrofin/flask-apispec that referenced this issue Sep 12, 2023
webargs 6.0.0 has incompatible changes for example:
 - Parser.use_args and Parser.use_kwargs now accept location (singular) instead
   of locations (plurala)

close: jmcarp#176
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.

3 participants