              if field.help_text:
                  schema['description'] = str(field.help_text)
              self.map_field_validators(field, schema)
  
              properties[field.field_name] = schema
  
          result = {
              'type': 'object',
              'properties': properties
          }
 
</s> remove                 required.append(field.field_name)
 </s> add                 required.append(self.get_field_name(field))
            properties[self.get_field_name(field)] = schema
              if field.help_text:
                  schema['description'] = str(field.help_text)
              self.map_field_validators(field, schema)
  
            properties[self.get_field_name(field)] = schema
  
          result = {
              'type': 'object',
              'properties': properties
          }
keep keep keep keep replace 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> 
rest_framework/schemas/openapi.py