Previously, we were using specific serializers to bind course relations and product relations in respective serializers. Now, we would like to be able to create/update product's course relations but the route in charge to create those relations is a nested one under course resource so currently course information are not returned in the response but we need those information from product detail view. That's why we decided to share the same serializer to return relation of Course or Product.
Purpose
Previously, we were using specific serializers to bind course relations and product relations in respective serializers. Now, we would like to be able to create/update product's course relations but the route in charge to create those relations is a nested one under course resource so currently course information are not returned in the response but we need those information from product detail view. That's why we decided to share the same serializer to return relation of Course or Product.
Proposal