I'm using drf-yasg to document my APIs. However, I'm running into a problem
I've a serializer in which one of the fields is set to write_only=True
.
class XYZSerializer(serializers.ModelSerializer):
status = serializers.BooleanField(default=True, write_only=True)
class Meta:
model = XYZ
fields = ('id', 'status')
When generating the swagger docs, field status
still shows in the Response fields. Technically, it should not.
How to correct this?
write_only=True
displays in response schema. – Blossom