          assert Serializer({'nested': {'a': '3', 'b': {}}}).data == {'nested': {'a': '3', 'c': '2'}}
          assert Serializer({'nested': {'a': '3', 'b': {'c': '4'}}}).data == {'nested': {'a': '3', 'c': '4'}}
  
      def test_default_for_allow_null(self):
          # allow_null=True should imply default=None
          class Serializer(serializers.Serializer):
              foo = serializers.CharField()
              bar = serializers.CharField(source='foo.bar', allow_null=True)
  
          assert Serializer({'foo': None}).data == {'foo': None, 'bar': None}
 
</s> remove     def test_not_required_output_for_allow_null_field(self):
        class ExampleSerializer(serializers.Serializer):
            omitted = serializers.CharField(required=False, allow_null=True)
            included = serializers.CharField()

        serializer = ExampleSerializer({'included': 'abc'})
        assert 'omitted' not in serializer.data

 </s> add  </s> remove             if not self.required:
                raise SkipField()
 </s> add 
        """
        Without an explicit default, allow_null implies default=None when serializing. #5518 #5708
        """
          assert Serializer({'nested': {'a': '3', 'b': {}}}).data == {'nested': {'a': '3', 'c': '2'}}
          assert Serializer({'nested': {'a': '3', 'b': {'c': '4'}}}).data == {'nested': {'a': '3', 'c': '4'}}
  
      def test_default_for_allow_null(self):
        """
        Without an explicit default, allow_null implies default=None when serializing. #5518 #5708
        """
          class Serializer(serializers.Serializer):
              foo = serializers.CharField()
              bar = serializers.CharField(source='foo.bar', allow_null=True)
  
          assert Serializer({'foo': None}).data == {'foo': None, 'bar': None}
keep keep keep keep replace keep keep keep keep keep
 Correct allow_null behaviour when required=False (#5888)

* Revert "Non-required fields with 'allow_null=True' should not imply a default value (#5639)"
    This reverts commit 905a5579dfaa717ad4210ddd285267bb9bbb9a43.
    Closes #5708

* Add test for allow_null + required=False
    Ref #5708: allow_null should imply default=None, even for non-required fields.

* Re-order allow_null and default in field docs
    default is prior to allow_null. allow_null implies an outgoing default=None.

* Adjust allow_null note. 
tests/test_serializer.py