apryor6 / flask_accepts

Easy, opinionated Flask input/output handling mixing Marshmallow with flask-restx
BSD 3-Clause "New" or "Revised" License
169 stars 40 forks source link

Fix error aggregation and body=None #107

Closed ghost closed 1 year ago

ghost commented 3 years ago

Two bugs noticed (may not be real bugs).

When no body is present (i.e. request.get_json() returns None) the schema is presented None to load from, whereas an empty JSON body could better be interpreted as {}. For a body schema with no required fields this leads to better behavior.

Error aggregation doesn't seem to have been working correctly, as error.data['errors'] never existed, and comment "If any parsing produced an error, combine them and reraise" hints this was the intended behavior.

apryor6 commented 3 years ago

Thanks - can you update to address test failures prior to merge?