SchemaGenerator doesn't pass request attribute · Issue #4278 · encode/django-rest-framework (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Steps to reproduce
Override get_serializer_class
for any view that inherits from GenericAPIView
and attempt to access the request
attribute when using the new SchemaGenerator
, or going through DefaultRouter
.
Expected behavior
The request
attribute is passed into SchemaGenerator
initialisation and subsequent methods have access to it.
Actual behavior
AttributeError: '<view-name>' object has no attribute 'request'