1👍
✅
You can send context in your serializer with additional fields.
CategorySerializer(data=self.category,context={'request': request,'course_id': test_course_id})
and get using context inside your serializer.
course_id = self.context.get('course_id')
Source:stackexchange.com