linzhiming0826 / sanic-restful

Simple framework for creating REST APIs
https://sanic-restful-api.readthedocs.io
MIT License
21 stars 9 forks source link

reqparse cannot abort when missing argument #11

Closed SHerlockHolmes9527 closed 1 year ago

SHerlockHolmes9527 commented 1 year ago

SanicException imported as abort try: from sanic.exceptions import abort except Exception: from sanic.exceptions import SanicException as abort

when some errors happened, abort is declared but not raised.

if errors: abort(status_code=400, message=errors)

if strict and req_temp.unparsed_arguments: abort( status_code=400, message='Unknown arguments: %s' % ', '.join( req_temp.unparsed_arguments.keys()))

return namespace

linzhiming0826 commented 1 year ago

it has already fixed it in 0.2.0