Closed sshishov closed 3 months ago
The error message is probably wrong, but we'll do a git blame and find out why this behavior was introduced. Maybe was asked or contributed by someone. Could you please check both the message and the behavior @pamella ?
Hello, @sshishov! We just released a correction for that in version 1.4.0
. Could you try the update and let us know if you are no longer experiencing the problem? Thanks!
Hi @pamella and @fjsj , we still were not able to test the fix as we stuck in v1.1.1
due to the issues mentioned above.
With the latest release we still getting errors during running our unit-test suite. I will shed a light on the issues we are having later on.
Description
We are currently in the middle of migration to RW serializers, meaning some viewsets has
get_read/write_serializer_class
implemented and some using old approach (1 serializer) which end-up being served fromget_serializer_class
. With the latest changes if the class implementsget_serializer_class
and does not implementserializer_class
attribute, then assertion error raised.What I Did
Below I will try to post the simple code snippet
This snippet is very good to find out if you are missing any serializer for any action (especially it is done during schema generation).
This code was not producing any errors in
1.1.x
version but produces this in1.2.x+
:We do override
get_serializer_class
but apparently in the RW serializer sources it is not checked.UPDATE:
Okay, the issue is a little bit different.
In our codebase we are calling
self.get_wirte_serializer
(note that we do not havewrite_serializer_class
attribute, we do not haveget_write_serializer_class
method, we rely only onget_serializer_class
in this case.Stack trace is the following:
Please note that the error is about
read
somehow: