Skip to content

Commit 9469638

Browse files
committed
Feat: drop get_schema_view
1 parent 5873060 commit 9469638

File tree

1 file changed

+0
-58
lines changed

1 file changed

+0
-58
lines changed

rest_framework/schemas/__init__.py

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +0,0 @@
1-
"""
2-
rest_framework.schemas
3-
4-
schemas:
5-
__init__.py
6-
generators.py # Top-down schema generation
7-
inspectors.py # Per-endpoint view introspection
8-
utils.py # Shared helper functions
9-
views.py # Houses `SchemaView`, `APIView` subclass.
10-
11-
We expose a minimal "public" API directly from `schemas`. This covers the
12-
basic use-cases:
13-
14-
from rest_framework.schemas import (
15-
AutoSchema,
16-
ManualSchema,
17-
get_schema_view,
18-
SchemaGenerator,
19-
)
20-
21-
Other access should target the submodules directly
22-
"""
23-
from rest_framework.settings import api_settings
24-
25-
from . import coreapi, openapi
26-
from .coreapi import AutoSchema, ManualSchema, SchemaGenerator # noqa
27-
from .inspectors import DefaultSchema # noqa
28-
29-
30-
def get_schema_view(
31-
title=None, url=None, description=None, urlconf=None, renderer_classes=None,
32-
public=False, patterns=None, generator_class=None,
33-
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
34-
permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES,
35-
version=None):
36-
"""
37-
Return a schema view.
38-
"""
39-
if generator_class is None:
40-
if coreapi.is_enabled():
41-
generator_class = coreapi.SchemaGenerator
42-
else:
43-
generator_class = openapi.SchemaGenerator
44-
45-
generator = generator_class(
46-
title=title, url=url, description=description,
47-
urlconf=urlconf, patterns=patterns, version=version
48-
)
49-
50-
# Avoid import cycle on APIView
51-
from .views import SchemaView
52-
return SchemaView.as_view(
53-
renderer_classes=renderer_classes,
54-
schema_generator=generator,
55-
public=public,
56-
authentication_classes=authentication_classes,
57-
permission_classes=permission_classes,
58-
)

0 commit comments

Comments
 (0)