twilio/flask-restful — pull request #323 by thirty3 (2014-10-24 07:22:22+00:00)
Title: Pass kwargs from api.add_resource to Resource.__init__ 

##### The problem
If you need to inject a dependency into a `Resource` you currently have to use `app.add_url_rule`. Trying to pass it via `api.add_resource` will not work because the `kwargs` are not passed to `Resource.as_view`. An exception will also be raised if you pass a named parameter that is not excepted by `werkzeug.routing.Rule`, since it does not swallow additional named parametes

http://stackoverflow.com/questions/25098661/flask-restful-add-resource-parameters/26526582

##### Proposed solution
- Pass `kwargs` to `Resource.as_view` from `api.add_resource`. This does however mean that the resource needs to swallow additional named parameters if you want to pass named arguments to `werkzeug.routing.Rule`.
- Filter out the named parameters that are specific for `werkzeug.routing.Rule` before passing the `kwargs` to `app.add_url_rule`

##### Test
Unit test added that demonstrates to wanted behaviour