Skip to content

Commit 0f5dfe8

Browse files
ta7uwrpkilby
authored andcommitted
Fix typo in schemas (#6332)
* Fix typo in generators.py * Fix typo in inspectors.py * message line too long * Change backslash to multiline strings * Removed trailing whitespace from assertion message
1 parent 9b7db8d commit 0f5dfe8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

rest_framework/schemas/generators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def is_api_view(callback):
5757
coreapi.Link for URL path {value_url} cannot be inserted into schema.
5858
Position conflicts with coreapi.Link for URL path {target_url}.
5959
60-
Attemped to insert link with keys: {keys}.
60+
Attempted to insert link with keys: {keys}.
6161
6262
Adjust URLs to avoid naming collision or override `SchemaGenerator.get_keys()`
6363
to customise schema structure.

rest_framework/schemas/inspectors.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ def __set__(self, instance, other):
163163
@property
164164
def view(self):
165165
"""View property."""
166-
assert self._view is not None, "Schema generation REQUIRES a view instance. (Hint: you accessed `schema` from the view class rather than an instance.)"
166+
assert self._view is not None, (
167+
"Schema generation REQUIRES a view instance. (Hint: you accessed "
168+
"`schema` from the view class rather than an instance.)"
169+
)
167170
return self._view
168171

169172
@view.setter
@@ -193,7 +196,7 @@ class AutoSchema(ViewInspector):
193196
"""
194197
Default inspector for APIView
195198
196-
Responsible for per-view instrospection and schema generation.
199+
Responsible for per-view introspection and schema generation.
197200
"""
198201
def __init__(self, manual_fields=None):
199202
"""
@@ -468,7 +471,7 @@ def __init__(self, fields, description='', encoding=None):
468471
Parameters:
469472
470473
* `fields`: list of `coreapi.Field` instances.
471-
* `descripton`: String description for view. Optional.
474+
* `description`: String description for view. Optional.
472475
"""
473476
super(ManualSchema, self).__init__()
474477
assert all(isinstance(f, coreapi.Field) for f in fields), "`fields` must be a list of coreapi.Field instances"
@@ -498,7 +501,9 @@ def __get__(self, instance, owner):
498501
return result
499502

500503
inspector_class = api_settings.DEFAULT_SCHEMA_CLASS
501-
assert issubclass(inspector_class, ViewInspector), "DEFAULT_SCHEMA_CLASS must be set to a ViewInspector (usually an AutoSchema) subclass"
504+
assert issubclass(inspector_class, ViewInspector), (
505+
"DEFAULT_SCHEMA_CLASS must be set to a ViewInspector (usually an AutoSchema) subclass"
506+
)
502507
inspector = inspector_class()
503508
inspector.view = instance
504509
return inspector

0 commit comments

Comments
 (0)