          model = ForeignKeySource
  
  
  class NullableForeignKeySourceSerializer(serializers.ModelSerializer):
      target = serializers.SlugRelatedField(slug_field='name', null=True)
  
      class Meta:
          model = NullableForeignKeySource
  
  
 
</s> remove             title = serializers.CharField(blank=True)
 </s> add             title = serializers.CharField(required=False) </s> remove         if model_field.has_default():
            kwargs['required'] = False
 </s> add         if has_default: </s> remove         kwargs['blank'] = model_field.blank

        if model_field.null or model_field.blank:
 </s> add         if model_field.null or model_field.blank or has_default:
    target = serializers.SlugRelatedField(slug_field='name', required=False)
          model = ForeignKeySource
  
  
  class NullableForeignKeySourceSerializer(serializers.ModelSerializer):
    target = serializers.SlugRelatedField(slug_field='name', required=False)
  
      class Meta:
          model = NullableForeignKeySource
  
  
keep keep keep keep replace keep keep keep keep keep
 Use new style of `required=<bool>` not `blank` or `null` 
rest_framework/tests/relations_slug.py