twilio/flask-restful — pull request #277 by the-gigi (2014-07-31 20:27:07+00:00)
Title: Added a parse_known_args() method to RequestParser and unit tests

Yesterday, I had a "user bug" where the user had a typo in one of the request parameter. The parameter had a default value. RequestParser.arse_args() just ignores unknown parameters, so the default value was used even though the user thought it specified a different value. The desired behavior in this case would be to notify the user that she provided a wrong parameter name and NOT going forward with the default. To accomodate this use case I added a parse_known_args() method in the spirit of argparse's [parse_known_args()](https://docs.python.org/dev/library/argparse.html#partial-parsing).

Note that I return the unknown parameters as a separate dictionary and not inside the namespace because I didn't want to change the format of the result namespace (which is parsed by the existing parse_args() method).

I added 3 test cases too:
* all args are known
* all args are unknown
* some args are unknown