def get_serializer_context(self):
        return {
            'request': self.request,
            'view': self,
            'router': self.request.wagtailapi_router
        }
The serialization context differs between listing and detail views.
dataset/ETHPy150Open torchbox/wagtail/wagtail/api/v2/endpoints.py/BaseAPIEndpoint.get_serializer_context