nxexox/python-rest-framework

Bug if important objects serializers and not required field

Closed this issue · 1 comments

from rest_framework import serializers

class A(serializers.Serializer):
    c = serializers.CharField()

class B(serializers.Serializer):
    a = A(required=False)

B(data={}).is_valid(raise_exception=True)  # raise Validation error
B(data={'a': None}).is_valid(raise_exception=True)  # raise Validation error
B(data={'a': {}})  # not raise

Fix in 0.3.14 version