Hi,
I am using Django to create an API, but I am encountering an issue with validation serializers. Here is my serializer class:
class InputSerializer(serializers.Serializer):
keyword = serializers.CharField(required=True, allow_blank=False, allow_null=False)
vi_name = serializers.CharField(required=False, allow_blank=False, allow_null=False)
The problem is the validation succeed when I send a request with {‘keyword’: ‘a’, ‘vi_name’:‘’} (I mean ‘vi_name’ is blank).
How to make the serializer validation fail when I send ‘vi_name’ blank or null?
Thank you!