1616from __future__import unicode_literals
1717
1818import itertools
19- import warnings
2019from collections import OrderedDict ,namedtuple
2120
2221from django .conf .urls import url
@@ -330,41 +329,12 @@ class DefaultRouter(SimpleRouter):
330329SchemaGenerator = SchemaGenerator
331330
332331def __init__ (self ,* args ,** kwargs ):
333- if 'schema_title' in kwargs :
334- warnings .warn (
335- "Including a schema directly via a router is now deprecated. "
336- "Use `get_schema_view()` instead." ,
337- DeprecationWarning ,stacklevel = 2
338- )
339- if 'schema_renderers' in kwargs :
340- assert 'schema_title' in kwargs ,'Missing "schema_title" argument.'
341- if 'schema_url' in kwargs :
342- assert 'schema_title' in kwargs ,'Missing "schema_title" argument.'
343- self .schema_title = kwargs .pop ('schema_title' ,None )
344- self .schema_url = kwargs .pop ('schema_url' ,None )
345- self .schema_renderers = kwargs .pop ('schema_renderers' ,self .default_schema_renderers )
346-
347332if 'root_renderers' in kwargs :
348333self .root_renderers = kwargs .pop ('root_renderers' )
349334else :
350335self .root_renderers = list (api_settings .DEFAULT_RENDERER_CLASSES )
351336super (DefaultRouter ,self ).__init__ (* args ,** kwargs )
352337
353- def get_schema_root_view (self ,api_urls = None ):
354- """
355- Return a schema root view.
356- """
357- schema_generator = self .SchemaGenerator (
358- title = self .schema_title ,
359- url = self .schema_url ,
360- patterns = api_urls
361- )
362-
363- return self .APISchemaView .as_view (
364- renderer_classes = self .schema_renderers ,
365- schema_generator = schema_generator ,
366- )
367-
368338def get_api_root_view (self ,api_urls = None ):
369339"""
370340 Return a basic root view.
@@ -384,10 +354,7 @@ def get_urls(self):
384354urls = super (DefaultRouter ,self ).get_urls ()
385355
386356if self .include_root_view :
387- if self .schema_title :
388- view = self .get_schema_root_view (api_urls = urls )
389- else :
390- view = self .get_api_root_view (api_urls = urls )
357+ view = self .get_api_root_view (api_urls = urls )
391358root_url = url (r'^$' ,view ,name = self .root_view_name )
392359urls .append (root_url )
393360