jmcarp / flask-apispec

MIT License
655 stars 157 forks source link

Strict schema flag #71

Open revmischa opened 6 years ago

revmischa commented 6 years ago

Getting this: /Users/cyber/.virtualenvs/jb/lib/python3.6/site-packages/webargs/core.py:293: UserWarning: It is highly recommended that you set strict=True on your schema so that the parser's error handler will be invoked when expected. "so that the parser's error handler will be invoked when expected.", UserWarning)

Would be nice if it handled errors or I could tell it to use strict somehow. I'm not clear on how to fix this warning.

rth commented 6 years ago

See http://webargs.readthedocs.io/en/latest/advanced.html#marshmallow-integration

You should always set strict=True (either as a class Meta option or in the Schema’s constructor) when passing a schema to webargs. This will ensure that the parser’s error handler is invoked when expected.