Repository: encode/django-rest-framework

Issue:
get_schema_view parameters lack SchemaGenerator parameters
## Checklist

- [ x ] I have verified that that issue exists against the `master` branch of Django REST framework.
- [ x ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [ x ] This is not a usage question. (Those should be directed to the [discussion group](https://groups.google.com/forum/#!forum/django-rest-framework) instead.)
- [ x ] This cannot be dealt with as a third party library. (We prefer new functionality to be [in the form of third party libraries](http://www.django-rest-framework.org/topics/third-party-resources/#about-third-party-packages) where possible.)
- [ x ] I have reduced the issue to the simplest possible case.
- [ ] I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)

## Steps to reproduce
Call `get_schema_view` with `patterns=something` and you get an error because it is not defined.

```
get_schema_view(title=None, url=None, renderer_classes=None):
     generator = SchemaGenerator(title=title, url=url)
 ```
[link](https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/schemas.py#L574)

but `SchemaGenerator` object allows:

```
class SchemaGenerator(object):
    def __init__(self, title=None, url=None, patterns=None, urlconf=None)
```

## Expected behavior
Be able to call `get_schema_view` with `patterns`.
I don't know why it is not allowed given that the `SchemaGenerator` object that is instantiated allows `patterns` to limit the inspected urls. 

## Actual behavior
`TypeError` unexpected keyword argument



Discussion:

Resolving patch:
diff --git a/rest_framework/documentation.py b/rest_framework/documentation.py
--- a/rest_framework/documentation.py
+++ b/rest_framework/documentation.py
@@ -6,7 +6,9 @@
 from rest_framework.schemas import SchemaGenerator, get_schema_view
 
 
-def get_docs_view(title=None, description=None, schema_url=None, public=True, generator_class=SchemaGenerator):
+def get_docs_view(
+        title=None, description=None, schema_url=None, public=True,
+        patterns=None, generator_class=SchemaGenerator):
     renderer_classes = [DocumentationRenderer, CoreJSONRenderer]
 
     return get_schema_view(
@@ -15,11 +17,14 @@ def get_docs_view(title=None, description=None, schema_url=None, public=True, ge
         description=description,
         renderer_classes=renderer_classes,
         public=public,
+        patterns=patterns,
         generator_class=generator_class,
     )
 
 
-def get_schemajs_view(title=None, description=None, schema_url=None, public=True, generator_class=SchemaGenerator):
+def get_schemajs_view(
+        title=None, description=None, schema_url=None, public=True,
+        patterns=None, generator_class=SchemaGenerator):
     renderer_classes = [SchemaJSRenderer]
 
     return get_schema_view(
@@ -28,16 +33,20 @@ def get_schemajs_view(title=None, description=None, schema_url=None, public=True
         description=description,
         renderer_classes=renderer_classes,
         public=public,
+        patterns=patterns,
         generator_class=generator_class,
     )
 
 
-def include_docs_urls(title=None, description=None, schema_url=None, public=True, generator_class=SchemaGenerator):
+def include_docs_urls(
+        title=None, description=None, schema_url=None, public=True,
+        patterns=None, generator_class=SchemaGenerator):
     docs_view = get_docs_view(
         title=title,
         description=description,
         schema_url=schema_url,
         public=public,
+        patterns=patterns,
         generator_class=generator_class,
     )
     schema_js_view = get_schemajs_view(
@@ -45,6 +54,7 @@ def include_docs_urls(title=None, description=None, schema_url=None, public=True
         description=description,
         schema_url=schema_url,
         public=public,
+        patterns=patterns,
         generator_class=generator_class,
     )
     urls = [
diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py
--- a/rest_framework/schemas.py
+++ b/rest_framework/schemas.py
@@ -695,18 +695,15 @@ def get(self, request, *args, **kwargs):
 
 
 def get_schema_view(
-    title=None,
-    url=None,
-    description=None,
-    urlconf=None,
-    renderer_classes=None,
-    public=False,
-    generator_class=SchemaGenerator,
-):
+        title=None, url=None, description=None, urlconf=None, renderer_classes=None,
+        public=False, patterns=None, generator_class=SchemaGenerator):
     """
     Return a schema view.
     """
-    generator = generator_class(title=title, url=url, description=description, urlconf=urlconf)
+    generator = generator_class(
+        title=title, url=url, description=description,
+        urlconf=urlconf, patterns=patterns,
+    )
     return SchemaView.as_view(
         renderer_classes=renderer_classes,
         schema_generator=generator,


Test patch: