In DRF v3.1, I have a nested serializer much like the one detailed in the docs - http://www.django-rest-framework.org/api-guide/serializers/#dealing-with-nested-objects
class SerializerA(serializers.Serializer):
details = DetailsSerializer(required=False)
However, when trying to use this serializer and not supplying the details, I receive the following:
{u'details': [u'This field may not be null.']}
This seems incorrect given the docs?
Has anyone else come across this or can verify this as a bug?
repr(SerializerA())
? You probably want to setallow_null
forDetailsSerializer
. – Kevin BrownSerializerA(): details = DetailsSerializer(required=False): a = CharField(max_length=100, min_length=1, required=True)
– Alan Sergeant