          assert data['properties']['default_false']['default'] is False, "default must be false"
          assert 'default' not in data['properties']['without_default'], "default must not be defined"
  
      def test_nullable_fields(self):
          class Model(models.Model):
              rw_field = models.CharField(null=True)
              ro_field = models.CharField(null=True)
  
 
</s> remove             properties[field.field_name] = schema
 </s> add             properties[self.get_field_name(field)] = schema </s> remove                 required.append(field.field_name)
 </s> add                 required.append(self.get_field_name(field))
    def test_custom_field_name(self):
        class CustomSchema(AutoSchema):
            def get_field_name(self, field):
                return 'custom_' + field.field_name

        class Serializer(serializers.Serializer):
            text_field = serializers.CharField()

        inspector = CustomSchema()

        data = inspector.map_serializer(Serializer())
        assert 'custom_text_field' in data['properties']
        assert 'text_field' not in data['properties']

          assert data['properties']['default_false']['default'] is False, "default must be false"
          assert 'default' not in data['properties']['without_default'], "default must not be defined"
  
    def test_custom_field_name(self):
        class CustomSchema(AutoSchema):
            def get_field_name(self, field):
                return 'custom_' + field.field_name

        class Serializer(serializers.Serializer):
            text_field = serializers.CharField()

        inspector = CustomSchema()

        data = inspector.map_serializer(Serializer())
        assert 'custom_text_field' in data['properties']
        assert 'text_field' not in data['properties']

      def test_nullable_fields(self):
          class Model(models.Model):
              rw_field = models.CharField(null=True)
              ro_field = models.CharField(null=True)
  
keep keep add keep keep keep keep keep
 Add a method for getting serializer field name (OpenAPI) (#7493)

* Add a method for getting serializer field name

* Add docs and test

Co-authored-by: Tom Christie <tom@tomchristie.com> 
tests/schemas/test_openapi.py