Skip to content

Commit 53f48d1

Browse files
committed
Allow customizing DefaultRouter's schema generator class
1 parent 51a6c07 commit 53f48d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_framework/routers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ class DefaultRouter(SimpleRouter):
316316
default_schema_renderers = None
317317
APIRootView = APIRootView
318318
APISchemaView = SchemaView
319+
SchemaGenerator = SchemaGenerator
319320

320321
def __init__(self, *args, **kwargs):
321322
if 'schema_title' in kwargs:
@@ -342,7 +343,7 @@ def get_schema_root_view(self, api_urls=None):
342343
"""
343344
Return a schema root view.
344345
"""
345-
schema_generator = SchemaGenerator(
346+
schema_generator = self.SchemaGenerator(
346347
title=self.schema_title,
347348
url=self.schema_url,
348349
patterns=api_urls

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy