Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
bug: webargs 5.0 introduces incompatibility with Flask < 1.0 #355
for Flask < 1.0, there is an error as follows:
I had to downgrade webargs to 4.4.1 to get it work.
So you need to update this framework requirement https://github.com/marshmallow-code/webargs/blob/dev/setup.py#L11 or update the code for the backward compatibility.
Thanks for reporting.
I don't fully understand the reason @sloria did it this way.
I wouldn't mind dropping flask < 1.0 if we had to since flask 1 has been out for a while and from my experience, there wasn't much trouble migrating.
Regarding the use of a protected method, I suppose we could call
Perhaps we could even add a bit of code from https://github.com/pallets/flask/blob/0.12-maintenance/flask/wrappers.py#L21 to preserve flask 0.x compatibility.
# We decode the json manually here instead of # using req.get_json() so that we can handle # JSONDecodeErrors consistently data = req._get_data_for_json(cache=True)
The reason it is done this way is so that a
try: self._cache["json"] = json_data = core.parse_json(data) except json.JSONDecodeError as e: if e.doc == "": return core.missing else: return self.handle_invalid_json_error(e, req)
Yeah, this seems like the way to go. Didn't see that method before.
I'm up for dropping Flask 1.0, but that's a breaking change for a major release. For now, let's use