I have a serializer field which works differently for read and write. I used PresentablePrimaryKeyRelatedField for that.
e.g:
car_type = PresentablePrimaryKeyRelatedField(
queryset=CarType.objects.all(),
presentation_serializer=CarTypeSerializer,
read_source=None
)
This works well when accessing the api, like in request i give an integer value to car_type field and in response it gives a dictionary to car_type field. Api request-response thing worked well.
Issue is with swagger documentation. In documentation, it gives car_type as integer field in both request and response schema.
How can i deal with that?