              # No write_only fields for response.
              for name, schema in item_schema['properties'].copy().items():
                  if 'writeOnly' in schema:
                      del item_schema['properties'][name]
                      item_schema['required'] = [f for f in item_schema['required'] if f != name]
  
          if is_list_view(path, method, self.view):
              response_schema = {
                  'type': 'array',
                  'items': item_schema,
 
</s> remove         return {
            'required': required,
            'properties': properties,
 </s> add         result = {
            'properties': properties
                    if 'required' in item_schema:
                        item_schema['required'] = [f for f in item_schema['required'] if f != name]
              # No write_only fields for response.
              for name, schema in item_schema['properties'].copy().items():
                  if 'writeOnly' in schema:
                      del item_schema['properties'][name]
                    if 'required' in item_schema:
                        item_schema['required'] = [f for f in item_schema['required'] if f != name]
  
          if is_list_view(path, method, self.view):
              response_schema = {
                  'type': 'array',
                  'items': item_schema,
keep keep keep keep replace keep keep keep keep keep
 OpenAPI: only include non-empty required property. (#6851)

Closes #6834 
rest_framework/schemas/openapi.py