SchemaGenerator doesn't pass request attribute · Issue #4278 · encode/django-rest-framework (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@decentral1se

Description

@decentral1se

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'